panorama/prisma/migrations/20230418191634_installed_default_now/migration.sql
Michael Zhang 1550d77ca6
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Use solid-start
2023-04-18 14:38:22 -05:00

14 lines
518 B
SQL

-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_App" (
"id" TEXT NOT NULL PRIMARY KEY,
"localName" TEXT NOT NULL,
"title" TEXT NOT NULL,
"installed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_App" ("id", "installed", "localName", "title") SELECT "id", "installed", "localName", "title" FROM "App";
DROP TABLE "App";
ALTER TABLE "new_App" RENAME TO "App";
CREATE UNIQUE INDEX "App_localName_key" ON "App"("localName");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;