diff --git a/app/Console/Commands/DbImport.php b/app/Console/Commands/DbImport.php deleted file mode 100644 index e04ffae4..00000000 --- a/app/Console/Commands/DbImport.php +++ /dev/null @@ -1,36 +0,0 @@ -in($this->argument('path'))->files(); - - foreach ($files as $file) { - $table = $file->getBasename('.json'); - /** @phpstan-ignore-next-line */ - $data = Json\decode(File\read($file->getPathname())); - - $this->info("Importing {$table} table..."); - - $this->withProgressBar( - /** @phpstan-ignore-next-line */ - Vec\chunk($data, 200), - fn (array $d) => DB::table($table)->insert($d), - ); - - $this->newLine(); - } - } -} diff --git a/config/database.php b/config/database.php index 16b5bd39..c24fbe1f 100644 --- a/config/database.php +++ b/config/database.php @@ -11,7 +11,7 @@ 'url' => env('DB_URL'), 'database' => env('DB_DATABASE', database_path('database.sqlite')), 'prefix' => '', - 'foreign_key_constraints' => false, + 'foreign_key_constraints' => true, ], 'testing' => [