diff --git a/interface/src/chat/common.ts b/interface/src/chat/common.ts index 0b406ce1..4c2fb03e 100644 --- a/interface/src/chat/common.ts +++ b/interface/src/chat/common.ts @@ -9,7 +9,7 @@ export const Message = z.object({ id: z.number(), user: ChatUser, type: z.enum(["message", "notice"]), - message: z.string(), + message: z.string().min(1).max(500), createdAt: z.string().datetime(), }); export type Message = z.infer; diff --git a/server/prisma/schema.prisma b/server/prisma/schema.prisma index 51b525cb..df9cec09 100644 --- a/server/prisma/schema.prisma +++ b/server/prisma/schema.prisma @@ -52,7 +52,7 @@ model Chat { user User @relation(fields: [userId], references: [id]) userId Int @map("user_id") type ChatType - message String + message String @db.VarChar(500) createdAt DateTime @default(now()) @map("created_at") @@map("chat") @@ -68,21 +68,21 @@ model Tag { } model TemplateChoice { - id Int @id @default(autoincrement()) - template Template @relation(fields: [templateId], references: [id]) - templateId Int @map("template_id") - name String + id Int @id @default(autoincrement()) + template Template @relation(fields: [templateId], references: [id]) + templateId Int @map("template_id") + name String @@map("template_choice") } model Template { - id Int @id @default(autoincrement()) - templateName String - title String - content String - resolution String - choices TemplateChoice[] + id Int @id @default(autoincrement()) + templateName String + title String + content String + resolution String + choices TemplateChoice[] @@map("template") } @@ -108,10 +108,10 @@ model UserAgendaVotable { } model UserTag { - user User @relation(fields: [userId], references: [id]) - userId Int @map("user_id") - tag Tag @relation(fields: [tagId], references: [id]) - tagId Int @map("tag_id") + user User @relation(fields: [userId], references: [id]) + userId Int @map("user_id") + tag Tag @relation(fields: [tagId], references: [id]) + tagId Int @map("tag_id") @@id([userId, tagId]) @@map("user_tag")