diff --git a/prisma/dev.db b/prisma/dev.db index 49ea322..2b1122d 100644 Binary files a/prisma/dev.db and b/prisma/dev.db differ diff --git a/prisma/dev.db-journal b/prisma/dev.db-journal index 87d8054..7354be6 100644 Binary files a/prisma/dev.db-journal and b/prisma/dev.db-journal differ diff --git a/prisma/migrations/20240908164302_dev/migration.sql b/prisma/migrations/20240908164302_dev/migration.sql deleted file mode 100644 index 822c906..0000000 --- a/prisma/migrations/20240908164302_dev/migration.sql +++ /dev/null @@ -1,11 +0,0 @@ --- CreateTable -CREATE TABLE "User" ( - "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, - "email" TEXT NOT NULL, - "name" TEXT, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - --- CreateIndex -CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); diff --git a/prisma/migrations/20240910061511_re/migration.sql b/prisma/migrations/20240910061511_re/migration.sql deleted file mode 100644 index 6dd87fc..0000000 --- a/prisma/migrations/20240910061511_re/migration.sql +++ /dev/null @@ -1,73 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `access_token` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `expires_at` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `id_token` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `provider` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `refresh_token` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `scope` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `session_state` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `token_type` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `type` on the `Account` table. All the data in the column will be lost. - - Added the required column `providerId` to the `Account` table without a default value. This is not possible if the table is not empty. - - Added the required column `providerType` to the `Account` table without a default value. This is not possible if the table is not empty. - - Added the required column `accessToken` to the `Session` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "User" ADD COLUMN "image" TEXT; - --- CreateTable -CREATE TABLE "VerificationRequest" ( - "id" TEXT NOT NULL PRIMARY KEY, - "identifier" TEXT NOT NULL, - "token" TEXT NOT NULL, - "expires" DATETIME NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - --- RedefineTables -PRAGMA defer_foreign_keys=ON; -PRAGMA foreign_keys=OFF; -CREATE TABLE "new_Account" ( - "id" TEXT NOT NULL PRIMARY KEY, - "userId" TEXT NOT NULL, - "providerType" TEXT NOT NULL, - "providerId" TEXT NOT NULL, - "providerAccountId" TEXT NOT NULL, - "refreshToken" TEXT, - "accessToken" TEXT, - "accessTokenExpires" DATETIME, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); -INSERT INTO "new_Account" ("createdAt", "id", "providerAccountId", "updatedAt", "userId") SELECT "createdAt", "id", "providerAccountId", "updatedAt", "userId" FROM "Account"; -DROP TABLE "Account"; -ALTER TABLE "new_Account" RENAME TO "Account"; -CREATE UNIQUE INDEX "Account_providerId_providerAccountId_key" ON "Account"("providerId", "providerAccountId"); -CREATE TABLE "new_Session" ( - "id" TEXT NOT NULL PRIMARY KEY, - "userId" TEXT NOT NULL, - "expires" DATETIME NOT NULL, - "sessionToken" TEXT NOT NULL, - "accessToken" TEXT NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); -INSERT INTO "new_Session" ("createdAt", "expires", "id", "sessionToken", "updatedAt", "userId") SELECT "createdAt", "expires", "id", "sessionToken", "updatedAt", "userId" FROM "Session"; -DROP TABLE "Session"; -ALTER TABLE "new_Session" RENAME TO "Session"; -CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken"); -CREATE UNIQUE INDEX "Session_accessToken_key" ON "Session"("accessToken"); -PRAGMA foreign_keys=ON; -PRAGMA defer_foreign_keys=OFF; - --- CreateIndex -CREATE UNIQUE INDEX "VerificationRequest_token_key" ON "VerificationRequest"("token"); - --- CreateIndex -CREATE UNIQUE INDEX "VerificationRequest_identifier_token_key" ON "VerificationRequest"("identifier", "token"); diff --git a/prisma/migrations/20240910062346_case/migration.sql b/prisma/migrations/20240910062346_case/migration.sql deleted file mode 100644 index 3156048..0000000 --- a/prisma/migrations/20240910062346_case/migration.sql +++ /dev/null @@ -1,112 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `accessToken` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `accessTokenExpires` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `createdAt` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `providerAccountId` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `providerId` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `providerType` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `refreshToken` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `updatedAt` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `userId` on the `Account` table. All the data in the column will be lost. - - You are about to drop the column `createdAt` on the `Referral` table. All the data in the column will be lost. - - You are about to drop the column `accessToken` on the `Session` table. All the data in the column will be lost. - - You are about to drop the column `createdAt` on the `Session` table. All the data in the column will be lost. - - You are about to drop the column `sessionToken` on the `Session` table. All the data in the column will be lost. - - You are about to drop the column `updatedAt` on the `Session` table. All the data in the column will be lost. - - You are about to drop the column `createdAt` on the `User` table. All the data in the column will be lost. - - You are about to drop the column `emailVerified` on the `User` table. All the data in the column will be lost. - - You are about to drop the column `updatedAt` on the `User` table. All the data in the column will be lost. - - You are about to drop the column `createdAt` on the `VerificationRequest` table. All the data in the column will be lost. - - You are about to drop the column `updatedAt` on the `VerificationRequest` table. All the data in the column will be lost. - - Added the required column `provider_account_id` to the `Account` table without a default value. This is not possible if the table is not empty. - - Added the required column `provider_id` to the `Account` table without a default value. This is not possible if the table is not empty. - - Added the required column `provider_type` to the `Account` table without a default value. This is not possible if the table is not empty. - - Added the required column `updated_at` to the `Account` table without a default value. This is not possible if the table is not empty. - - Added the required column `user_id` to the `Account` table without a default value. This is not possible if the table is not empty. - - Added the required column `access_token` to the `Session` table without a default value. This is not possible if the table is not empty. - - Added the required column `session_token` to the `Session` table without a default value. This is not possible if the table is not empty. - - Added the required column `updated_at` to the `Session` table without a default value. This is not possible if the table is not empty. - - Added the required column `updated_at` to the `User` table without a default value. This is not possible if the table is not empty. - - Added the required column `updated_at` to the `VerificationRequest` 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_Account" ( - "id" TEXT NOT NULL PRIMARY KEY, - "user_id" TEXT NOT NULL, - "provider_type" TEXT NOT NULL, - "provider_id" TEXT NOT NULL, - "provider_account_id" TEXT NOT NULL, - "refresh_token" TEXT, - "access_token" TEXT, - "access_token_expires" DATETIME, - "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updated_at" DATETIME NOT NULL, - CONSTRAINT "Account_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); -INSERT INTO "new_Account" ("id") SELECT "id" FROM "Account"; -DROP TABLE "Account"; -ALTER TABLE "new_Account" RENAME TO "Account"; -CREATE UNIQUE INDEX "Account_provider_id_provider_account_id_key" ON "Account"("provider_id", "provider_account_id"); -CREATE TABLE "new_Referral" ( - "id" TEXT NOT NULL PRIMARY KEY, - "code" TEXT NOT NULL, - "createdby_id" TEXT NOT NULL, - "usedby_id" TEXT, - "isUsed" BOOLEAN NOT NULL DEFAULT false, - "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - CONSTRAINT "Referral_createdby_id_fkey" FOREIGN KEY ("createdby_id") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT "Referral_usedby_id_fkey" FOREIGN KEY ("usedby_id") REFERENCES "User" ("id") ON DELETE SET NULL ON UPDATE CASCADE -); -INSERT INTO "new_Referral" ("code", "createdby_id", "id", "isUsed", "usedby_id") SELECT "code", "createdby_id", "id", "isUsed", "usedby_id" FROM "Referral"; -DROP TABLE "Referral"; -ALTER TABLE "new_Referral" RENAME TO "Referral"; -CREATE UNIQUE INDEX "Referral_code_key" ON "Referral"("code"); -CREATE TABLE "new_Session" ( - "id" TEXT NOT NULL PRIMARY KEY, - "userId" TEXT NOT NULL, - "expires" DATETIME NOT NULL, - "session_token" TEXT NOT NULL, - "access_token" TEXT NOT NULL, - "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updated_at" DATETIME NOT NULL, - CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); -INSERT INTO "new_Session" ("expires", "id", "userId") SELECT "expires", "id", "userId" FROM "Session"; -DROP TABLE "Session"; -ALTER TABLE "new_Session" RENAME TO "Session"; -CREATE UNIQUE INDEX "Session_session_token_key" ON "Session"("session_token"); -CREATE UNIQUE INDEX "Session_access_token_key" ON "Session"("access_token"); -CREATE TABLE "new_User" ( - "id" TEXT NOT NULL PRIMARY KEY, - "name" TEXT, - "email" TEXT, - "email_verified" DATETIME, - "image" TEXT, - "role" TEXT NOT NULL DEFAULT 'PARTICIPANT', - "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updated_at" DATETIME NOT NULL -); -INSERT INTO "new_User" ("email", "id", "image", "name", "role") SELECT "email", "id", "image", "name", "role" FROM "User"; -DROP TABLE "User"; -ALTER TABLE "new_User" RENAME TO "User"; -CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); -CREATE TABLE "new_VerificationRequest" ( - "id" TEXT NOT NULL PRIMARY KEY, - "identifier" TEXT NOT NULL, - "token" TEXT NOT NULL, - "expires" DATETIME NOT NULL, - "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updated_at" DATETIME NOT NULL -); -INSERT INTO "new_VerificationRequest" ("expires", "id", "identifier", "token") SELECT "expires", "id", "identifier", "token" FROM "VerificationRequest"; -DROP TABLE "VerificationRequest"; -ALTER TABLE "new_VerificationRequest" RENAME TO "VerificationRequest"; -CREATE UNIQUE INDEX "VerificationRequest_token_key" ON "VerificationRequest"("token"); -CREATE UNIQUE INDEX "VerificationRequest_identifier_token_key" ON "VerificationRequest"("identifier", "token"); -PRAGMA foreign_keys=ON; -PRAGMA defer_foreign_keys=OFF; diff --git a/prisma/migrations/20240910062624_map/migration.sql b/prisma/migrations/20240910062624_map/migration.sql deleted file mode 100644 index c4748eb..0000000 --- a/prisma/migrations/20240910062624_map/migration.sql +++ /dev/null @@ -1,28 +0,0 @@ -/* - Warnings: - - - You are about to drop the `Account` table. If the table is not empty, all the data it contains will be lost. - -*/ --- DropTable -PRAGMA foreign_keys=off; -DROP TABLE "Account"; -PRAGMA foreign_keys=on; - --- CreateTable -CREATE TABLE "accounts" ( - "id" TEXT NOT NULL PRIMARY KEY, - "user_id" TEXT NOT NULL, - "provider_type" TEXT NOT NULL, - "provider_id" TEXT NOT NULL, - "provider_account_id" TEXT NOT NULL, - "refresh_token" TEXT, - "access_token" TEXT, - "access_token_expires" DATETIME, - "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updated_at" DATETIME NOT NULL, - CONSTRAINT "accounts_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - --- CreateIndex -CREATE UNIQUE INDEX "accounts_provider_id_provider_account_id_key" ON "accounts"("provider_id", "provider_account_id"); diff --git a/prisma/migrations/20240910063008_acc/migration.sql b/prisma/migrations/20240910063008_acc/migration.sql deleted file mode 100644 index 070bc3e..0000000 --- a/prisma/migrations/20240910063008_acc/migration.sql +++ /dev/null @@ -1,60 +0,0 @@ -/* - Warnings: - - - You are about to drop the `Session` table. If the table is not empty, all the data it contains will be lost. - - You are about to drop the column `access_token_expires` on the `accounts` table. All the data in the column will be lost. - - You are about to drop the column `provider_id` on the `accounts` table. All the data in the column will be lost. - - You are about to drop the column `provider_type` on the `accounts` table. All the data in the column will be lost. - - Added the required column `provider` to the `accounts` table without a default value. This is not possible if the table is not empty. - - Added the required column `type` to the `accounts` table without a default value. This is not possible if the table is not empty. - -*/ --- DropIndex -DROP INDEX "Session_access_token_key"; - --- DropIndex -DROP INDEX "Session_session_token_key"; - --- DropTable -PRAGMA foreign_keys=off; -DROP TABLE "Session"; -PRAGMA foreign_keys=on; - --- CreateTable -CREATE TABLE "sessions" ( - "id" TEXT NOT NULL PRIMARY KEY, - "session_token" TEXT NOT NULL, - "user_id" TEXT NOT NULL, - "expires" DATETIME NOT NULL, - CONSTRAINT "sessions_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE -); - --- RedefineTables -PRAGMA defer_foreign_keys=ON; -PRAGMA foreign_keys=OFF; -CREATE TABLE "new_accounts" ( - "id" TEXT NOT NULL PRIMARY KEY, - "user_id" TEXT NOT NULL, - "type" TEXT NOT NULL, - "provider" TEXT NOT NULL, - "provider_account_id" TEXT NOT NULL, - "refresh_token" TEXT, - "access_token" TEXT, - "expires_at" INTEGER, - "token_type" TEXT, - "scope" TEXT, - "id_token" TEXT, - "session_state" TEXT, - "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updated_at" DATETIME NOT NULL, - CONSTRAINT "accounts_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE -); -INSERT INTO "new_accounts" ("access_token", "created_at", "id", "provider_account_id", "refresh_token", "updated_at", "user_id") SELECT "access_token", "created_at", "id", "provider_account_id", "refresh_token", "updated_at", "user_id" FROM "accounts"; -DROP TABLE "accounts"; -ALTER TABLE "new_accounts" RENAME TO "accounts"; -CREATE UNIQUE INDEX "accounts_provider_provider_account_id_key" ON "accounts"("provider", "provider_account_id"); -PRAGMA foreign_keys=ON; -PRAGMA defer_foreign_keys=OFF; - --- CreateIndex -CREATE UNIQUE INDEX "sessions_session_token_key" ON "sessions"("session_token"); diff --git a/prisma/migrations/20240910110357_dev/migration.sql b/prisma/migrations/20240910110357_dev/migration.sql deleted file mode 100644 index 665d80b..0000000 --- a/prisma/migrations/20240910110357_dev/migration.sql +++ /dev/null @@ -1,31 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `college` on the `Form` table. All the data in the column will be lost. - - Added the required column `entity_name` to the `Form` 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_Form" ( - "id" TEXT NOT NULL PRIMARY KEY, - "name" TEXT NOT NULL, - "usn" TEXT NOT NULL, - "email" TEXT NOT NULL, - "contact" TEXT, - "designation" TEXT, - "photo_url" TEXT NOT NULL, - "college_id_card" TEXT, - "entity_name" TEXT NOT NULL, - "referral_id" TEXT, - "created_by_id" TEXT NOT NULL, - "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - CONSTRAINT "Form_created_by_id_fkey" FOREIGN KEY ("created_by_id") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT "Form_referral_id_fkey" FOREIGN KEY ("referral_id") REFERENCES "Referral" ("id") ON DELETE SET NULL ON UPDATE CASCADE -); -INSERT INTO "new_Form" ("college_id_card", "contact", "created_at", "created_by_id", "email", "id", "name", "photo_url", "referral_id", "usn") SELECT "college_id_card", "contact", "created_at", "created_by_id", "email", "id", "name", "photo_url", "referral_id", "usn" FROM "Form"; -DROP TABLE "Form"; -ALTER TABLE "new_Form" RENAME TO "Form"; -PRAGMA foreign_keys=ON; -PRAGMA defer_foreign_keys=OFF; diff --git a/prisma/migrations/20240909174414_test/migration.sql b/prisma/migrations/20240912033604_new/migration.sql similarity index 52% rename from prisma/migrations/20240909174414_test/migration.sql rename to prisma/migrations/20240912033604_new/migration.sql index df00822..73b03cf 100644 --- a/prisma/migrations/20240909174414_test/migration.sql +++ b/prisma/migrations/20240912033604_new/migration.sql @@ -1,16 +1,22 @@ -/* - Warnings: - - - The primary key for the `User` table will be changed. If it partially fails, the table could be left without primary key constraint. +-- CreateTable +CREATE TABLE "User" ( + "id" TEXT NOT NULL PRIMARY KEY, + "name" TEXT, + "email" TEXT, + "email_verified" DATETIME, + "image" TEXT, + "role" TEXT NOT NULL DEFAULT 'PARTICIPANT', + "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" DATETIME NOT NULL +); -*/ -- CreateTable -CREATE TABLE "Account" ( +CREATE TABLE "accounts" ( "id" TEXT NOT NULL PRIMARY KEY, - "userId" TEXT NOT NULL, + "user_id" TEXT NOT NULL, "type" TEXT NOT NULL, "provider" TEXT NOT NULL, - "providerAccountId" TEXT NOT NULL, + "provider_account_id" TEXT NOT NULL, "refresh_token" TEXT, "access_token" TEXT, "expires_at" INTEGER, @@ -18,20 +24,18 @@ CREATE TABLE "Account" ( "scope" TEXT, "id_token" TEXT, "session_state" TEXT, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE + "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" DATETIME NOT NULL, + CONSTRAINT "accounts_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); -- CreateTable -CREATE TABLE "Session" ( +CREATE TABLE "sessions" ( "id" TEXT NOT NULL PRIMARY KEY, - "sessionToken" TEXT NOT NULL, - "userId" TEXT NOT NULL, + "session_token" TEXT NOT NULL, + "user_id" TEXT NOT NULL, "expires" DATETIME NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE + CONSTRAINT "sessions_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); -- CreateTable @@ -41,7 +45,7 @@ CREATE TABLE "Referral" ( "createdby_id" TEXT NOT NULL, "usedby_id" TEXT, "isUsed" BOOLEAN NOT NULL DEFAULT false, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, CONSTRAINT "Referral_createdby_id_fkey" FOREIGN KEY ("createdby_id") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "Referral_usedby_id_fkey" FOREIGN KEY ("usedby_id") REFERENCES "User" ("id") ON DELETE SET NULL ON UPDATE CASCADE ); @@ -53,40 +57,41 @@ CREATE TABLE "Form" ( "usn" TEXT NOT NULL, "email" TEXT NOT NULL, "contact" TEXT, + "designation" TEXT, "photo_url" TEXT NOT NULL, + "college_id_card" TEXT, + "entity_name" TEXT NOT NULL, "referral_id" TEXT, "created_by_id" TEXT NOT NULL, "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "college_id_card" TEXT NOT NULL, - "college" TEXT, CONSTRAINT "Form_created_by_id_fkey" FOREIGN KEY ("created_by_id") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "Form_referral_id_fkey" FOREIGN KEY ("referral_id") REFERENCES "Referral" ("id") ON DELETE SET NULL ON UPDATE CASCADE ); --- RedefineTables -PRAGMA defer_foreign_keys=ON; -PRAGMA foreign_keys=OFF; -CREATE TABLE "new_User" ( +-- CreateTable +CREATE TABLE "VerificationRequest" ( "id" TEXT NOT NULL PRIMARY KEY, - "name" TEXT, - "email" TEXT, - "emailVerified" DATETIME, - "role" TEXT NOT NULL DEFAULT 'PARTICIPANT', - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL + "identifier" TEXT NOT NULL, + "token" TEXT NOT NULL, + "expires" DATETIME NOT NULL, + "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" DATETIME NOT NULL ); -INSERT INTO "new_User" ("createdAt", "email", "id", "name", "updatedAt") SELECT "createdAt", "email", "id", "name", "updatedAt" FROM "User"; -DROP TABLE "User"; -ALTER TABLE "new_User" RENAME TO "User"; + +-- CreateIndex CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); -PRAGMA foreign_keys=ON; -PRAGMA defer_foreign_keys=OFF; -- CreateIndex -CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId"); +CREATE UNIQUE INDEX "accounts_provider_provider_account_id_key" ON "accounts"("provider", "provider_account_id"); -- CreateIndex -CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken"); +CREATE UNIQUE INDEX "sessions_session_token_key" ON "sessions"("session_token"); -- CreateIndex CREATE UNIQUE INDEX "Referral_code_key" ON "Referral"("code"); + +-- CreateIndex +CREATE UNIQUE INDEX "VerificationRequest_token_key" ON "VerificationRequest"("token"); + +-- CreateIndex +CREATE UNIQUE INDEX "VerificationRequest_identifier_token_key" ON "VerificationRequest"("identifier", "token");