(core) repair a migration test when running against postgres

Summary:
This is fixing some fall-out from some environmental changes after
another batch of tests were moved to grist-core.

Test Plan: this is fixing a test, no app changes

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D4156
This commit is contained in:
Paul Fitzpatrick 2024-01-04 13:18:17 -05:00
parent 2a206dfcf8
commit 15a73fdaf0

View File

@ -79,6 +79,13 @@ describe('migrations', function() {
beforeEach(async function() { beforeEach(async function() {
await home.connect(); await home.connect();
// If testing against postgres, remove all tables.
// If SQLite, we're using a fresh in-memory db each time.
const sqlite = home.connection.driver.options.type === 'sqlite';
if (!sqlite) {
await home.connection.query('DROP SCHEMA public CASCADE');
await home.connection.query('CREATE SCHEMA public');
}
await createInitialDb(home.connection, false); await createInitialDb(home.connection, false);
}); });