code-distortion / adapt

A Laravel package that builds databases for your tests, improving their speed
MIT License
24 stars 3 forks source link

adapt:clear command fails. #7

Open manu144x opened 1 year ago

manu144x commented 1 year ago

Description:

When running the command

php artisan adapt:clear --force

Logs:



   CodeDistortion\Adapt\Exceptions\AdaptBootException

  The Database name "" is invalid

  at vendor/code-distortion/adapt/src/Exceptions/AdaptBootException.php:58
     54▕      * @return self
     55▕      */
     56▕     public static function databaseNameIsInvalid($database): self
     57▕     {
  ➜  58▕         return new self("The Database name \"$database\" is invalid");
     59▕     }
     60▕ }
     61▕

      +19 vendor frames
  20  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()```

#### Other Relevant Details:

- Using SSD or HDD storage? (might be relevant for slowness issues): 
manu144x commented 1 year ago

I should also mention this is how my config looks like:


    protected function databaseInit(DatabaseDefinition $database): void
    {
        // The default one needs to be fully managed here too, it will not use the config
        $database->connection('mysql')
            ->initialImports([
                'mysql' => ['database/schema/mysql-schema.dump'], //the normal migration will not recognize the squashed migrations in the schema
            ])
            ->migrations('database/migrations')
            ->seeders(['DatabaseSeeder'])
            ->isNotABrowserTest()
            ->transaction()
            ->noJournal()
            ->snapshots('afterSeeders')
            ->makeDefault();

        $this->prepareConnection('mysql_reporting')
            ->initialImports([
                'mysql' => ['database/schema/mysql_reporting-schema.dump'],
            ])->migrations('database/migrations/mysql_reporting')
            ->seeders(['CreateMysqlReportingFederatedConnectionSeeder'])
            ->isNotABrowserTest()
            ->transaction()
            ->noJournal()
            ->snapshots('afterSeeders');
    }