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") 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? /// [FinalChatResult] result Json? chat Chat @relation(fields: [chatId], references: [id], onDelete: Cascade) user User? @relation(fields: [userId], references: [id]) @@map("message") }