I have a migration which is altering a column in a table in Postgres (dev) to JSON. This is a custom query like.
DB::statement('ALTER TABLE users ALTER COLUMN options TYPE JSON USING (options)::json');
However due to this migration my tests are failing as I am using SQLite in testing. How can I run a different alteration command for test vs dev? I am looking for something like:
if ($testEnvironment) {
// run something
} else {
// run above command
}
@martinbean the issue with using Postgres as DB for testing is that it is really slow for tests compared to SQLite. Any suggestions for not doing this?
@CLab I'd recommend you look at why your tests are running slowly.
If your live application runs on Postgres then your testing should be done on postgres too. Otherwise theres no guarantees your application will work the same when you publish to live.