mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-11-29 17:28:02 +01:00
refactor(db): fix warning table to follow prisma naming convention
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the `Warnings` table. If the table is not empty, all the data it contains will be lost.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "Warnings" DROP CONSTRAINT "Warnings_modId_fkey";
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "Warnings" DROP CONSTRAINT "Warnings_userId_fkey";
|
||||
|
||||
-- RenameTable
|
||||
ALTER TABLE "Warnings" RENAME TO "Warning";
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Warning" ADD CONSTRAINT "Warning_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Warning" ADD CONSTRAINT "Warning_modId_fkey" FOREIGN KEY ("modId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Warning" RENAME CONSTRAINT "Warnings_pkey" TO "Warning_pkey";
|
||||
@@ -39,8 +39,8 @@ model User {
|
||||
VerifyVerifier Verify[] @relation("verVerifier")
|
||||
SusUser Sus[] @relation("susUser")
|
||||
SusMod Sus[] @relation("susMod")
|
||||
WarnUser Warnings[] @relation("warnUser")
|
||||
WarnMod Warnings[] @relation("warnMod")
|
||||
WarnUser Warning[] @relation("warnUser")
|
||||
WarnMod Warning[] @relation("warnMod")
|
||||
RestrictUser Restrict[] @relation("restUser")
|
||||
RestrictMod Restrict[] @relation("restMod")
|
||||
RestrictEndMod Restrict[] @relation("endRestMod")
|
||||
@@ -93,7 +93,7 @@ model Sus {
|
||||
note String
|
||||
}
|
||||
|
||||
model Warnings {
|
||||
model Warning {
|
||||
id Int @id @default(autoincrement())
|
||||
user User @relation("warnUser", fields: [userId], references: [id])
|
||||
userId String
|
||||
|
||||
Reference in New Issue
Block a user