Skip to content

Commit

Permalink
fix(message): fix message maximum length
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowSuno committed Aug 28, 2023
1 parent f8fd129 commit 6cfad01
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion interface/src/chat/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof Message>;
30 changes: 15 additions & 15 deletions server/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
}
Expand All @@ -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")
Expand Down

0 comments on commit 6cfad01

Please sign in to comment.