panorama/prisma/migrations/20230418191634_installed_default_now/migration.sql

15 lines
518 B
MySQL
Raw Normal View History

2023-04-18 07:38:22 +00:00
-- 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;