I have a lot of unit tests with many factories. But due to foreign keys I need even more factories in each test.
Is it possible to disable foreign keys during testing? I tried to use 'foreign_key_constraints' => false, but there are no effects.
'pgsql_testing' => [
'driver' => 'pgsql',
'host' => env('DB_HOST_TESTING', '127.0.0.1'),
'port' => env('DB_PORT_TESTING', '5432'),
'database' => env('DB_DATABASE_TESTING', 'forge'),
'username' => env('DB_USERNAME_TESTING', 'forge'),
'password' => env('DB_PASSWORD_TESTING', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
'foreign_key_constraints' => false, //does not help
],
I use PostgreSQL 10.7 and Laravel 5.8
Aucun commentaire:
Enregistrer un commentaire