chore(db): add AppSetting model

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-05-16 20:10:40 +02:00
parent d25a7e9ff5
commit 364b1cd7e0
2 changed files with 27 additions and 0 deletions
@@ -0,0 +1,18 @@
-- Manual migration to add AppSetting table
-- This SQL is for SQLite and stores JSON in a TEXT column
CREATE TABLE IF NOT EXISTS "AppSetting" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"key" TEXT NOT NULL UNIQUE,
"value" TEXT NOT NULL,
"description" TEXT,
"updatedAt" DATETIME NOT NULL DEFAULT (CURRENT_TIMESTAMP),
"updatedBy" TEXT
);
-- Optional: trigger to update updatedAt on row update
CREATE TRIGGER IF NOT EXISTS "AppSetting_updatedAt"
AFTER UPDATE ON "AppSetting"
BEGIN
UPDATE "AppSetting" SET "updatedAt" = CURRENT_TIMESTAMP WHERE "id" = NEW."id";
END;