| 1 | import path from 'node:path'; |
| 2 | import { createDatabase, seedBuiltInRows |
| 3 | import { migrate } |
| 4 | |
| 5 | const MIGRATIONS = path |
| 6 | import.meta.dirname, |
| 7 | '../../../packages/db/drizzle', |
| 8 | ); |
| 9 | |
| 10 | /** Brings the test database up to date, built-in rows included, as a deploy does. Run once before any suite: two migrators racing on a fresh database collide creating the journal table. */ |
| 11 | export async function migrateTestDatabase |
| 12 | const { db, |
| 13 | await migrate(db |
| 14 | await seedBuiltInRows(db |
| 15 | await pool.end |
| 16 | } |