This commit is contained in:
@@ -51,14 +51,14 @@ async function instance(hostId: string, retired = false) {
|
||||
|
||||
describe('host deletion', () => {
|
||||
it('adds the deletion marker to existing host schemas without losing hosts', async () => {
|
||||
const { ensureHostSchema } = await import('../../src/lib/server/hosts/schema.js');
|
||||
const { migrateHostSchema } = await import('../../src/lib/server/hosts/schema.js');
|
||||
const legacy = new Database(':memory:');
|
||||
try {
|
||||
legacy.exec(
|
||||
"CREATE TABLE ec_hosts(id TEXT PRIMARY KEY, name TEXT NOT NULL); INSERT INTO ec_hosts VALUES('old','Existing host')"
|
||||
);
|
||||
ensureHostSchema(legacy);
|
||||
ensureHostSchema(legacy);
|
||||
migrateHostSchema(legacy);
|
||||
migrateHostSchema(legacy);
|
||||
expect(legacy.prepare('SELECT * FROM ec_hosts').get()).toEqual({
|
||||
id: 'old',
|
||||
name: 'Existing host',
|
||||
@@ -99,8 +99,6 @@ describe('host deletion', () => {
|
||||
const file = join(fixture.root, 'game-files-sentinel');
|
||||
await writeFile(file, 'Game files remain');
|
||||
const { db } = await import('../../src/lib/server/db/index.js');
|
||||
const { ensureGameFileSchema } = await import('../../src/lib/server/game-files/schema.js');
|
||||
ensureGameFileSchema(db());
|
||||
db()
|
||||
.prepare(
|
||||
"INSERT INTO game_file_libraries(id,name,game,description,created_at) VALUES('library','T5','t5','',?)"
|
||||
|
||||
Reference in New Issue
Block a user