feat(db): add vcmute database

This commit is contained in:
smyalygames 2023-02-11 00:35:35 +00:00
parent 4b6dde3af2
commit b14de47934
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,17 @@
-- CreateTable
CREATE TABLE "VCMute" (
"id" SERIAL NOT NULL,
"userId" TEXT NOT NULL,
"modId" TEXT NOT NULL,
"time" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"endTime" TIMESTAMP(3),
"reason" TEXT,
CONSTRAINT "VCMute_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "VCMute" ADD CONSTRAINT "VCMute_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "VCMute" ADD CONSTRAINT "VCMute_modId_fkey" FOREIGN KEY ("modId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -46,6 +46,8 @@ model User {
BanEndMod Ban[] @relation("endBanMod") BanEndMod Ban[] @relation("endBanMod")
TempBanUser TempBan[] @relation("tbanUser") TempBanUser TempBan[] @relation("tbanUser")
TempBanMod TempBan[] @relation("tbanMod") TempBanMod TempBan[] @relation("tbanMod")
VCMuteUser VCMute[] @relation("vcMuteUser")
VCMuteMod VCMute[] @relation("vcMuteMod")
} }
model Verify { model Verify {
@ -124,3 +126,14 @@ model TempBan {
active Boolean @default(true) active Boolean @default(true)
reason String reason String
} }
model VCMute {
id Int @id @default(autoincrement())
user User @relation("vcMuteUser", fields: [userId], references: [id])
userId String
mod User @relation("vcMuteMod", fields: [modId], references: [id])
modId String
time DateTime @default(now())
endTime DateTime?
reason String?
}