ava/prisma/migrations/20241120075128_oops/migration.sql

21 lines
608 B
MySQL
Raw Normal View History

2024-11-20 02:17:45 -08:00
/*
Warnings:
- You are about to drop the column `currentAvatarId` on the `User` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_User" (
"userId" TEXT NOT NULL PRIMARY KEY,
"identifier" TEXT NOT NULL,
"name" TEXT
);
INSERT INTO "new_User" ("identifier", "name", "userId") SELECT "identifier", "name", "userId" FROM "User";
DROP TABLE "User";
ALTER TABLE "new_User" RENAME TO "User";
CREATE UNIQUE INDEX "User_userId_key" ON "User"("userId");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;