21 lines
608 B
MySQL
21 lines
608 B
MySQL
|
/*
|
||
|
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;
|