mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Speed up migrations in tests
This commit is contained in:
parent
b876cf368a
commit
08cc4f1db9
1 changed files with 2 additions and 1 deletions
|
|
@ -57,7 +57,8 @@ export async function createTestDB(opts?: { pure?: boolean }) {
|
|||
>`select tablename from pg_tables where schemaname = current_schema()`.execute(kysely);
|
||||
|
||||
for (const { tablename } of rows) {
|
||||
await kysely.schema.dropTable(tablename).ifExists().cascade().execute();
|
||||
if (tablename.startsWith('kysely_')) continue;
|
||||
await sql`truncate table ${sql.ref(tablename)} cascade`.execute(kysely);
|
||||
}
|
||||
|
||||
await kysely.destroy();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue