67 lines
2.0 KiB
Plaintext
67 lines
2.0 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
email String @unique
|
|
name String
|
|
passwordHash String @map("password_hash")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
recordings Recording[]
|
|
generatedApps GeneratedApp[]
|
|
|
|
@@map("users")
|
|
}
|
|
|
|
model Recording {
|
|
id String @id @default(uuid())
|
|
userId String @map("user_id")
|
|
title String
|
|
audioFilePath String @map("audio_file_path")
|
|
duration Int
|
|
transcript String? @db.Text
|
|
summary String? @db.Text
|
|
isTranscribing Boolean @default(false) @map("is_transcribing")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
generatedApps GeneratedApp[]
|
|
|
|
@@index([userId])
|
|
@@map("recordings")
|
|
}
|
|
|
|
model GeneratedApp {
|
|
id String @id @default(uuid())
|
|
userId String @map("user_id")
|
|
recordingId String @map("recording_id")
|
|
title String
|
|
description String?
|
|
htmlContent String @db.Text @map("html_content")
|
|
prdContent String? @db.Text @map("prd_content")
|
|
uiUxDesign String? @db.Text @map("ui_ux_design")
|
|
appType String? @map("app_type")
|
|
status String @default("completed")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
recording Recording @relation(fields: [recordingId], references: [id], onDelete: Cascade)
|
|
|
|
@@index([userId])
|
|
@@index([recordingId])
|
|
@@map("generated_apps")
|
|
}
|