feat(db): add end mod for temp bans

This commit is contained in:
smyalygames 2023-02-16 15:26:22 +00:00
parent dadaacd636
commit f3fa1398e8
2 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "TempBan" ADD COLUMN "endModId" TEXT;
-- AddForeignKey
ALTER TABLE "TempBan" ADD CONSTRAINT "TempBan_endModId_fkey" FOREIGN KEY ("endModId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;

View File

@ -49,6 +49,7 @@ 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")
TempBanEndMod TempBan[] @relation("endTbanMod")
VCMuteUser VCMute[] @relation("vcMuteUser") VCMuteUser VCMute[] @relation("vcMuteUser")
VCMuteMod VCMute[] @relation("vcMuteMod") VCMuteMod VCMute[] @relation("vcMuteMod")
} }
@ -139,6 +140,8 @@ model TempBan {
mod User @relation("tbanMod", fields: [modId], references: [id]) mod User @relation("tbanMod", fields: [modId], references: [id])
modId String modId String
startTime DateTime @default(now()) startTime DateTime @default(now())
endMod User? @relation("endTbanMod", fields: [endModId], references: [id])
endModId String?
endTime DateTime endTime DateTime
active Boolean @default(true) active Boolean @default(true)
reason String reason String