vision-agent-landing / prisma /schema.prisma
wuyiqun0718's picture
update
159e7fa
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")
}