thomaswilson-sveltekit/prisma/migrations/20260313211532_add_fields_to_photo_stream/migration.sql

25 lines
1 KiB
MySQL
Raw Normal View History

2026-03-15 17:33:04 +00:00
/*
Warnings:
- Added the required column `description` to the `PhotoPost` table without a default value. This is not possible if the table is not empty.
- Added the required column `filePath` to the `PhotoPost` table without a default value. This is not possible if the table is not empty.
- Added the required column `title` to the `PhotoPost` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_PhotoPost" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"filePath" TEXT NOT NULL,
"title" TEXT NOT NULL,
"description" TEXT NOT NULL
);
INSERT INTO "new_PhotoPost" ("createdAt", "id") SELECT "createdAt", "id" FROM "PhotoPost";
DROP TABLE "PhotoPost";
ALTER TABLE "new_PhotoPost" RENAME TO "PhotoPost";
CREATE UNIQUE INDEX "PhotoPost_filePath_key" ON "PhotoPost"("filePath");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;