mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-09-15 12:42:22 +02:00
feat(db): add warnings table
This commit is contained in:
parent
7dde12f456
commit
36bd0eb7a9
17
prisma/migrations/20230214100026_warnings/migration.sql
Normal file
17
prisma/migrations/20230214100026_warnings/migration.sql
Normal file
@ -0,0 +1,17 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Warnings" (
|
||||
"id" SERIAL NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"modId" TEXT NOT NULL,
|
||||
"time" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"active" BOOLEAN NOT NULL DEFAULT true,
|
||||
"note" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "Warnings_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Warnings" ADD CONSTRAINT "Warnings_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Warnings" ADD CONSTRAINT "Warnings_modId_fkey" FOREIGN KEY ("modId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
@ -39,6 +39,8 @@ model User {
|
||||
VerifyVerifier Verify[] @relation("verVerifier")
|
||||
SusUser Sus[] @relation("susUser")
|
||||
SusMod Sus[] @relation("susMod")
|
||||
WarnUser Warnings[] @relation("warnUser")
|
||||
WarnMod Warnings[] @relation("warnMod")
|
||||
RestrictUser Restrict[] @relation("restUser")
|
||||
RestrictMod Restrict[] @relation("restMod")
|
||||
RestrictEndMod Restrict[] @relation("endRestMod")
|
||||
@ -91,6 +93,17 @@ model Sus {
|
||||
note String
|
||||
}
|
||||
|
||||
model Warnings {
|
||||
id Int @id @default(autoincrement())
|
||||
user User @relation("warnUser", fields: [userId], references: [id])
|
||||
userId String
|
||||
mod User @relation("warnMod", fields: [modId], references: [id])
|
||||
modId String
|
||||
time DateTime @default(now())
|
||||
active Boolean @default(true)
|
||||
note String
|
||||
}
|
||||
|
||||
model Restrict {
|
||||
id Int @id @default(autoincrement())
|
||||
user User @relation("restUser", fields: [userId], references: [id])
|
||||
|
Loading…
x
Reference in New Issue
Block a user