This commit is contained in:
Ivan Grachyov
2025-12-26 23:36:21 +03:00
parent 0f218c1519
commit ca773a56c6
18 changed files with 315 additions and 7 deletions

View File

@@ -18,6 +18,8 @@ model User {
Session Session[]
UserPreferences UserPreferences?
ChatMessage ChatMessage[]
}
model Session {
@@ -34,7 +36,26 @@ model UserPreferences {
userId String @id
toggleInputHotkey String? @default("")
toggleOutputHotkey String? @default("")
volumes Json? @default("{}")
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}
model ChatMessage {
id String @id
userId String
channelId Int
content String
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id], onDelete: Restrict)
channel ChatChannel @relation(fields: [channelId], references: [id], onDelete: Cascade)
}
model ChatChannel {
id Int @id
name String @unique
messages ChatMessage[]
}