364b1cd7e0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
19 lines
577 B
SQL
19 lines
577 B
SQL
-- 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;
|