wishlist-app/prisma/migrations/20220212205507_add_public_option/migration.sql
Benny Samir Hierl d085d4b762 allow wishlist to be not public
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
2022-02-12 22:26:38 +01:00

16 lines
653 B
SQL

-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Wishlist" (
"id" TEXT NOT NULL PRIMARY KEY,
"public" BOOLEAN NOT NULL DEFAULT true,
"title" TEXT NOT NULL,
"imageSrc" TEXT NOT NULL,
"slugUrlText" TEXT NOT NULL,
"description" TEXT NOT NULL DEFAULT ''
);
INSERT INTO "new_Wishlist" ("description", "id", "imageSrc", "slugUrlText", "title") SELECT "description", "id", "imageSrc", "slugUrlText", "title" FROM "Wishlist";
DROP TABLE "Wishlist";
ALTER TABLE "new_Wishlist" RENAME TO "Wishlist";
CREATE UNIQUE INDEX "Wishlist_slugUrlText_key" ON "Wishlist"("slugUrlText");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;