wip(TRUEREF-0018): commit version-scoped indexing work
This commit is contained in:
@@ -35,14 +35,28 @@ function createTestDb(): Database.Database {
|
||||
client.pragma('foreign_keys = ON');
|
||||
|
||||
const migrationsFolder = join(import.meta.dirname, '../../../lib/server/db/migrations');
|
||||
const migrationSql = readFileSync(join(migrationsFolder, '0000_large_master_chief.sql'), 'utf-8');
|
||||
|
||||
// Apply all migration files in order
|
||||
const migration0 = readFileSync(join(migrationsFolder, '0000_large_master_chief.sql'), 'utf-8');
|
||||
const migration1 = readFileSync(join(migrationsFolder, '0001_quick_nighthawk.sql'), 'utf-8');
|
||||
|
||||
const statements = migrationSql
|
||||
// Apply first migration
|
||||
const statements0 = migration0
|
||||
.split('--> statement-breakpoint')
|
||||
.map((statement) => statement.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
for (const statement of statements) {
|
||||
for (const statement of statements0) {
|
||||
client.exec(statement);
|
||||
}
|
||||
|
||||
// Apply second migration
|
||||
const statements1 = migration1
|
||||
.split('--> statement-breakpoint')
|
||||
.map((statement) => statement.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
for (const statement of statements1) {
|
||||
client.exec(statement);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user