This repository has been archived by the owner on Oct 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9187a14
commit 2fb4043
Showing
9 changed files
with
1,009 additions
and
13 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
prisma/migrations/20240902170604_userverification/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
-- CreateEnum | ||
CREATE TYPE "VerificationStatus" AS ENUM ('Waiting', 'Approved', 'Rejected', 'Revoked'); | ||
|
||
-- AlterTable | ||
ALTER TABLE "Guild" ADD COLUMN "VerifyAttachEnabled" BOOLEAN NOT NULL DEFAULT false, | ||
ADD COLUMN "VerifyDetailEnabled" BOOLEAN NOT NULL DEFAULT false, | ||
ADD COLUMN "VerifyTempPaused" BOOLEAN NOT NULL DEFAULT false, | ||
ADD COLUMN "VerifyUnverifiedRoleId" TEXT NOT NULL DEFAULT '', | ||
ADD COLUMN "VerifyVerifiedRoleId" TEXT NOT NULL DEFAULT ''; | ||
|
||
-- CreateTable | ||
CREATE TABLE "UserVerificationData" ( | ||
"GuildId" TEXT NOT NULL, | ||
"UserId" TEXT NOT NULL, | ||
"Banned" BOOLEAN NOT NULL DEFAULT false | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "UserVerificationHistory" ( | ||
"VerificationHistoryId" SERIAL NOT NULL, | ||
"GuildId" TEXT NOT NULL, | ||
"UserId" TEXT NOT NULL, | ||
"Status" "VerificationStatus" NOT NULL DEFAULT 'Waiting', | ||
"CheckerUserId" TEXT NOT NULL DEFAULT '', | ||
"CheckerNote" TEXT NOT NULL DEFAULT '', | ||
"Detail" TEXT NOT NULL DEFAULT '', | ||
"Attachment" TEXT NOT NULL DEFAULT '', | ||
"RejectReason" TEXT NOT NULL DEFAULT '', | ||
"CreatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"UpdatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "UserVerificationHistory_pkey" PRIMARY KEY ("VerificationHistoryId") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "UserVerificationAttachment" ( | ||
"GuildId" TEXT NOT NULL, | ||
"UserId" TEXT NOT NULL, | ||
"Attachment" TEXT NOT NULL | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "UserVerificationData_GuildId_UserId_key" ON "UserVerificationData"("GuildId", "UserId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "UserVerificationAttachment_GuildId_UserId_key" ON "UserVerificationAttachment"("GuildId", "UserId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UserVerificationData" ADD CONSTRAINT "UserVerificationData_GuildId_fkey" FOREIGN KEY ("GuildId") REFERENCES "Guild"("GuildId") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UserVerificationHistory" ADD CONSTRAINT "UserVerificationHistory_GuildId_UserId_fkey" FOREIGN KEY ("GuildId", "UserId") REFERENCES "UserVerificationData"("GuildId", "UserId") ON DELETE CASCADE ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.