mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Merge branch 'ci-truncate' into 'main'
Speed up migrations in tests See merge request soapbox-pub/ditto!557
This commit is contained in:
commit
ef7c9e14db
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);
|
>`select tablename from pg_tables where schemaname = current_schema()`.execute(kysely);
|
||||||
|
|
||||||
for (const { tablename } of rows) {
|
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();
|
await kysely.destroy();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue