feat: add plan title field with data migration

This commit is contained in:
2026-01-12 22:32:45 +01:00
parent 9db5466fb2
commit 3de2661f46
8 changed files with 72 additions and 7 deletions

View File

@@ -0,0 +1,19 @@
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Plan" (
"id" TEXT NOT NULL PRIMARY KEY,
"title" TEXT NOT NULL DEFAULT 'Cat Plan',
"password" TEXT NOT NULL,
"startDate" DATETIME NOT NULL,
"endDate" DATETIME NOT NULL,
"instructions" TEXT,
"webhookUrl" TEXT,
"notifyAll" BOOLEAN NOT NULL DEFAULT true,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_Plan" ("createdAt", "endDate", "id", "instructions", "notifyAll", "password", "startDate", "webhookUrl") SELECT "createdAt", "endDate", "id", "instructions", "notifyAll", "password", "startDate", "webhookUrl" FROM "Plan";
DROP TABLE "Plan";
ALTER TABLE "new_Plan" RENAME TO "Plan";
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;