mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-17 21:44:23 +01:00
Merge branch 'ci-truncate' into 'main'
Speed up migrations in tests See merge request soapbox-pub/ditto!557
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user