This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import type Database from 'better-sqlite3';
|
||||
import { defaultFleetSettings } from '../../src/lib/fleet-settings.js';
|
||||
import { migrateHostSchema } from '../../src/lib/server/hosts/schema.js';
|
||||
import { migrateGameFileSchema } from '../../src/lib/server/game-files/schema.js';
|
||||
export function initializeStandaloneSettings(handle: Database.Database) {
|
||||
handle.exec(`CREATE TABLE IF NOT EXISTS settings (key TEXT PRIMARY KEY,value TEXT NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS retention_controls (category TEXT NOT NULL,record_id TEXT NOT NULL,protected INTEGER NOT NULL DEFAULT 0,resolved_at TEXT,PRIMARY KEY(category,record_id));
|
||||
@@ -7,4 +9,7 @@ export function initializeStandaloneSettings(handle: Database.Database) {
|
||||
handle
|
||||
.prepare("INSERT OR IGNORE INTO settings(key,value) VALUES('fleet_settings',?)")
|
||||
.run(JSON.stringify(defaultFleetSettings));
|
||||
// These isolated library tests mock db(), bypassing startup migrations.
|
||||
migrateHostSchema(handle);
|
||||
migrateGameFileSchema(handle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user