add db connection, refactor code, add db migration files

This commit is contained in:
lbenedar
2026-04-03 18:59:15 +03:00
parent d5577f10d7
commit a16edb9b61
28 changed files with 587 additions and 345 deletions

View File

@@ -0,0 +1,15 @@
CREATE TABLE IF NOT EXISTS foundry_state (
id INTEGER PRIMARY KEY AUTOINCREMENT,
is_admin BOOLEAN NOT NULL DEFAULT FALSE,
is_setup BOOLEAN NOT NULL DEFAULT TRUE,
state_type INTEGER NOT NULL,
created_at DATETIME NOT NULL DEFAULT current_timestamp
);
CREATE TABLE IF NOT EXISTS options (
id INTEGER PRIMARY KEY AUTOINCREMENT,
state_id INTEGER UNIQUE,
lang TEXT NOT NULL,
FOREIGN KEY (state_id) REFERENCES foundry_state(id) ON DELETE CASCADE
);