mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-12 10:25:49 +00:00
wip
This commit is contained in:
39
prisma/migrations/20241126160711_add/migration.sql
Normal file
39
prisma/migrations/20241126160711_add/migration.sql
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `island` 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" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"name" TEXT,
|
||||
"email" TEXT,
|
||||
"emailVerified" BOOLEAN NOT NULL DEFAULT false,
|
||||
"firstPaymentDone" BOOLEAN NOT NULL DEFAULT false,
|
||||
"verified" BOOLEAN NOT NULL DEFAULT false,
|
||||
"house_name" TEXT,
|
||||
"id_card" TEXT,
|
||||
"dob" DATETIME,
|
||||
"image" TEXT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
"phoneNumber" TEXT NOT NULL,
|
||||
"phoneNumberVerified" BOOLEAN NOT NULL DEFAULT false,
|
||||
"role" TEXT,
|
||||
"lang" TEXT,
|
||||
"atollId" TEXT,
|
||||
"islandId" TEXT,
|
||||
CONSTRAINT "user_atollId_fkey" FOREIGN KEY ("atollId") REFERENCES "Atoll" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
|
||||
CONSTRAINT "user_islandId_fkey" FOREIGN KEY ("islandId") REFERENCES "Island" ("id") ON DELETE SET NULL ON UPDATE CASCADE
|
||||
);
|
||||
INSERT INTO "new_user" ("createdAt", "dob", "email", "emailVerified", "firstPaymentDone", "house_name", "id", "id_card", "image", "lang", "name", "phoneNumber", "phoneNumberVerified", "role", "updatedAt", "verified") SELECT "createdAt", "dob", "email", "emailVerified", "firstPaymentDone", "house_name", "id", "id_card", "image", "lang", "name", "phoneNumber", "phoneNumberVerified", "role", "updatedAt", "verified" FROM "user";
|
||||
DROP TABLE "user";
|
||||
ALTER TABLE "new_user" RENAME TO "user";
|
||||
CREATE UNIQUE INDEX "user_email_key" ON "user"("email");
|
||||
CREATE UNIQUE INDEX "user_id_card_key" ON "user"("id_card");
|
||||
CREATE UNIQUE INDEX "user_phoneNumber_key" ON "user"("phoneNumber");
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
Reference in New Issue
Block a user