80 lines
2.1 KiB
Plaintext
80 lines
2.1 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
binaryTargets = ["native", "linux-musl-arm64-openssl-3.0.x", "linux-arm64-openssl-3.0.x"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Project {
|
|
id String @id @default(uuid())
|
|
title String
|
|
slug String @unique
|
|
status ProjectStatus @default(DRAFT)
|
|
contentJson Json
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
assets Asset[]
|
|
|
|
formSubmissions FormSubmission[]
|
|
|
|
// 인증 도입을 위한 관계: 프로젝트는 특정 User 가 소유할 수 있다.
|
|
userId String?
|
|
user User? @relation(fields: [userId], references: [id])
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
email String @unique
|
|
passwordHash String
|
|
tokenVersion Int @default(0)
|
|
emailVerified Boolean @default(false)
|
|
emailVerifyToken String? @unique
|
|
emailVerifyTokenExpiresAt DateTime?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
projects Project[]
|
|
|
|
formSubmissions FormSubmission[]
|
|
}
|
|
|
|
model Asset {
|
|
id String @id @default(uuid())
|
|
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
|
projectId String
|
|
kind String
|
|
url String
|
|
hash String?
|
|
meta Json?
|
|
createdAt DateTime @default(now())
|
|
}
|
|
|
|
enum ProjectStatus {
|
|
DRAFT
|
|
PUBLISHED
|
|
ARCHIVED
|
|
}
|
|
|
|
model FormSubmission {
|
|
id String @id @default(uuid())
|
|
project Project? @relation(fields: [projectId], references: [id], onDelete: SetNull)
|
|
projectId String?
|
|
projectSlug String
|
|
user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
|
|
userId String?
|
|
payloadJson Json
|
|
sensitiveEnc String?
|
|
metaJson Json?
|
|
createdAt DateTime @default(now())
|
|
}
|