mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-06-30 16:23:57 +00:00
wip
This commit is contained in:
11
prisma/migrations/20241125021358_add/migration.sql
Normal file
11
prisma/migrations/20241125021358_add/migration.sql
Normal file
@ -0,0 +1,11 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[id_card]` on the table `user` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "user" ADD COLUMN "id_card" TEXT;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "user_id_card_key" ON "user"("id_card");
|
2
prisma/migrations/20241125021453_add/migration.sql
Normal file
2
prisma/migrations/20241125021453_add/migration.sql
Normal file
@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "user" ADD COLUMN "island" TEXT;
|
2
prisma/migrations/20241125021534_add/migration.sql
Normal file
2
prisma/migrations/20241125021534_add/migration.sql
Normal file
@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "user" ADD COLUMN "house_name" TEXT;
|
2
prisma/migrations/20241125021636_add/migration.sql
Normal file
2
prisma/migrations/20241125021636_add/migration.sql
Normal file
@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "user" ADD COLUMN "dob" DATETIME;
|
30
prisma/migrations/20241126142344_test/migration.sql
Normal file
30
prisma/migrations/20241126142344_test/migration.sql
Normal file
@ -0,0 +1,30 @@
|
||||
-- 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,
|
||||
"island" TEXT,
|
||||
"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
|
||||
);
|
||||
INSERT INTO "new_user" ("createdAt", "dob", "email", "emailVerified", "firstPaymentDone", "house_name", "id", "id_card", "image", "island", "lang", "name", "phoneNumber", "phoneNumberVerified", "role", "updatedAt", "verified") SELECT "createdAt", "dob", "email", "emailVerified", "firstPaymentDone", "house_name", "id", "id_card", "image", "island", "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;
|
17
prisma/migrations/20241126151827_add/migration.sql
Normal file
17
prisma/migrations/20241126151827_add/migration.sql
Normal file
@ -0,0 +1,17 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Atoll" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"name" TEXT NOT NULL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Island" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"atollId" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
CONSTRAINT "Island_atollId_fkey" FOREIGN KEY ("atollId") REFERENCES "Atoll" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
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