vision-agent / prisma /schema.prisma
wuyiqunLu
feat: add responseBody field and serving data to hooks (#93)
bc1cf4e unverified
raw
history blame
1.43 kB
generator client {
provider = "prisma-client-js"
}
generator json {
provider = "prisma-json-types-generator"
}
datasource db {
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL")
directUrl = env("POSTGRES_URL_NON_POOLING")
}
model User {
id String @id @default(cuid())
name String
email String @unique
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
avatar String?
chats Chat[]
message Message[]
@@map("user")
}
model Chat {
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
title String @default("(no title)")
mediaUrl String
userId String?
user User? @relation(fields: [userId], references: [id])
messages Message[]
@@map("chat")
}
model Message {
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
userId String?
chatId String
mediaUrl String
prompt String
response String?
/// [FinalCodeBody]
result Json?
/// [AgentResponseBodies]
responseBody Json?
chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade)
user User? @relation(fields: [userId], references: [id])
@@map("message")
}