Finish & fix schema

This commit is contained in:
Isaac 2022-04-27 15:19:16 +01:00
parent d1bab9799d
commit 4e51032a0b

View File

@ -22,7 +22,7 @@ model ArchivedChannel {
model ArchivedMessage { model ArchivedMessage {
author ArchivedUser @relation(fields: [ticketId, authorId], references: [ticketId, userId]) author ArchivedUser @relation(fields: [ticketId, authorId], references: [ticketId, userId])
authorId String @db.VarChar(19) authorId String @db.VarChar(19)
content String content String @db.Text
createdAt DateTime @default(now()) createdAt DateTime @default(now())
deleted Boolean @default(false) deleted Boolean @default(false)
edited Boolean @default(false) edited Boolean @default(false)
@ -74,7 +74,6 @@ model Category {
discordCategory String @db.VarChar(19) discordCategory String @db.VarChar(19)
emoji String emoji String
enableFeedback Boolean @default(false) enableFeedback Boolean @default(false)
feedback Feedback[]
guild Guild @relation(fields: [guildId], references: [id]) guild Guild @relation(fields: [guildId], references: [id])
guildId String @db.VarChar(19) guildId String @db.VarChar(19)
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
@ -94,24 +93,28 @@ model Category {
} }
model Feedback { model Feedback {
category Category? @relation(fields: [categoryId], references: [id]) comment String?
categoryId Int? createdAt DateTime @default(now())
comment String? @db.VarChar(4000) guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
id Int @id @default(autoincrement()) guildId String @db.VarChar(19)
rating Int id Int @id @default(autoincrement())
ticket Ticket @relation(fields: [ticketId], references: [id]) rating Int
ticketId String @unique @db.VarChar(19) ticket Ticket @relation(fields: [ticketId], references: [id])
user User? @relation(fields: [userId], references: [id]) ticketId String @unique @db.VarChar(19)
userId String? @db.VarChar(19) user User? @relation(fields: [userId], references: [id])
userId String? @db.VarChar(19)
@@map("feedback")
} }
model Guild { model Guild {
autoTag Json?
archive Boolean @default(true) archive Boolean @default(true)
blocklist Json blocklist Json
categories Category[] categories Category[]
createdAt DateTime @default(now()) createdAt DateTime @default(now())
errorColour String @default("RED") errorColour String @default("RED")
feedback Feedback[]
id String @id @db.VarChar(19) id String @id @db.VarChar(19)
logChannel String? @db.VarChar(19) logChannel String? @db.VarChar(19)
primaryColour String @default("#009999") primaryColour String @default("#009999")
@ -124,21 +127,24 @@ model Guild {
model Question { model Question {
answers QuestionAnswer[] answers QuestionAnswer[]
createdAt DateTime @default(now())
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
category Category? @relation(fields: [categoryId], references: [id]) category Category? @relation(fields: [categoryId], references: [id])
categoryId Int? categoryId Int?
maxLength Int @default(4000) label String
minLength Int @default(0) maxLength Int? @default(4000)
order Int? minLength Int? @default(0)
order Int
placeholder String? @db.VarChar(100) placeholder String? @db.VarChar(100)
required Boolean @default(true) required Boolean @default(true)
style Int @default(2) style Int @default(2)
value String? @db.VarChar(4000) value String? @db.Text
@@map("questions") @@map("questions")
} }
model QuestionAnswer { model QuestionAnswer {
createdAt DateTime @default(now())
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
ticket Ticket @relation(fields: [ticketId], references: [id]) ticket Ticket @relation(fields: [ticketId], references: [id])
ticketId String @db.VarChar(19) ticketId String @db.VarChar(19)
@ -146,7 +152,7 @@ model QuestionAnswer {
questionId Int questionId Int
user User @relation(fields: [userId], references: [id]) user User @relation(fields: [userId], references: [id])
userId String @db.VarChar(19) userId String @db.VarChar(19)
value String? @db.VarChar(4000) value String? @db.Text
@@map("questionAnswers") @@map("questionAnswers")
} }