This commit is contained in:
seb
2026-10-29 03:17:47 +01:00
parent b0521a4ea6
commit 75a83bdc28
21 changed files with 701 additions and 24 deletions

View File

@@ -1,3 +1,5 @@
import { SCHEMA_VERSION } from './migrate.js';
const UTC_NOW = "strftime('%Y-%m-%dT%H:%M:%fZ', 'now')";
export const INIT_META = `
@@ -5,7 +7,7 @@ CREATE TABLE IF NOT EXISTS meta (
"key" TEXT PRIMARY KEY,
value TEXT NOT NULL
);
INSERT OR IGNORE INTO meta ("key", value) VALUES ('version', '1');
INSERT OR IGNORE INTO meta ("key", value) VALUES ('version', '${SCHEMA_VERSION}');
`;
export const INIT_LANGUAGE = `
@@ -629,6 +631,9 @@ CREATE TABLE IF NOT EXISTS posterminal (
sync_root_articles INTEGER NOT NULL DEFAULT 1,
lastseen_at TEXT,
updated_at TEXT NOT NULL DEFAULT (${UTC_NOW}),
sort INTEGER NOT NULL DEFAULT 0,
enabled INTEGER NOT NULL DEFAULT 1,
clientversion TEXT,
FOREIGN KEY (company_id) REFERENCES company(id) ON DELETE CASCADE,
FOREIGN KEY (root_category_id) REFERENCES category(id) ON DELETE SET NULL
);