From d1bab9799d7a2f68ba8c87a2b81d7a60d01d2b57 Mon Sep 17 00:00:00 2001 From: Isaac Date: Wed, 27 Apr 2022 00:15:12 +0100 Subject: [PATCH] Add feedback --- prisma/schema.prisma | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index d649f5a..8f6b78f 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -73,6 +73,8 @@ model Category { description String discordCategory String @db.VarChar(19) emoji String + enableFeedback Boolean @default(false) + feedback Feedback[] guild Guild @relation(fields: [guildId], references: [id]) guildId String @db.VarChar(19) id Int @id @default(autoincrement()) @@ -91,6 +93,19 @@ model Category { @@map("categories") } +model Feedback { + category Category? @relation(fields: [categoryId], references: [id]) + categoryId Int? + comment String? @db.VarChar(4000) + id Int @id @default(autoincrement()) + rating Int + ticket Ticket @relation(fields: [ticketId], references: [id]) + ticketId String @unique @db.VarChar(19) + user User? @relation(fields: [userId], references: [id]) + userId String? @db.VarChar(19) + +} + model Guild { archive Boolean @default(true) blocklist Json @@ -164,6 +179,8 @@ model Ticket { createdAt DateTime @default(now()) createdBy User @relation(name: "TicketsCreatedByUser", fields: [createdById], references: [id]) createdById String @db.VarChar(19) + feedback Feedback? + feedbackId Int? firstResponseAt DateTime? deleted Boolean @default(false) guild Guild @relation(fields: [guildId], references: [id]) @@ -189,6 +206,7 @@ model Ticket { model User { createdAt DateTime @default(now()) + feedback Feedback[] id String @id @db.VarChar(19) messageCount Int @default(0) ticketsCreated Ticket[] @relation("TicketsCreatedByUser")