refactor: migrate legacy wire namespace to wrn
Quality / quality (ubuntu-latest) (push) Failing after 9m49s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-12 18:51:15 +05:30
parent ec23dd4c93
commit 2c960fc1dc
488 changed files with 27306 additions and 19063 deletions
+4 -4
View File
@@ -105,7 +105,7 @@ for (const [label, driver] of [
}
test("migration runner: parse, migrate, status, rollback", async () => {
const dir = mkdtempSync(join(tmpdir(), "wire-mig-"));
const dir = mkdtempSync(join(tmpdir(), "wrn-mig-"));
writeFileSync(
join(dir, "0001_init.sql"),
"-- +up\nCREATE TABLE t (id INTEGER PRIMARY KEY, n TEXT);\n-- +down\nDROP TABLE t;",
@@ -166,15 +166,15 @@ test("migration lock rejects a concurrent runner and recovers expired locks", as
const db = createDb(sqlite());
const migrations = [{ name: "0001_lock", up: "CREATE TABLE locked_test (id INTEGER)", down: "" }];
await db.exec(
"CREATE TABLE _wire_migration_locks (name TEXT PRIMARY KEY, owner TEXT NOT NULL, expires_at TEXT NOT NULL)",
"CREATE TABLE _wrn_migration_locks (name TEXT PRIMARY KEY, owner TEXT NOT NULL, expires_at TEXT NOT NULL)",
);
await db.exec("INSERT INTO _wire_migration_locks (name, owner, expires_at) VALUES (?, ?, ?)", [
await db.exec("INSERT INTO _wrn_migration_locks (name, owner, expires_at) VALUES (?, ?, ?)", [
"global",
"other",
new Date(Date.now() + 60_000).toISOString(),
]);
await expect(applyMigrations(db, migrations)).rejects.toThrow("WRN-DB-MIGRATION-LOCKED");
await db.exec("UPDATE _wire_migration_locks SET expires_at = ?", [new Date(0).toISOString()]);
await db.exec("UPDATE _wrn_migration_locks SET expires_at = ?", [new Date(0).toISOString()]);
expect(await applyMigrations(db, migrations)).toEqual(["0001_lock"]);
await db.close();
});