40 lines
1.1 KiB
Plaintext
40 lines
1.1 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 = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
uid String @id @default(uuid()) //@default(autoincrement())
|
|
email String @unique
|
|
name String?
|
|
nickname String
|
|
passwordHash String
|
|
userAuthToken String @unique
|
|
role String @default("USER")
|
|
status Boolean @default(false)
|
|
at_created DateTime @default(now())
|
|
at_updated DateTime @updatedAt
|
|
boards Board[] // Board 모델과의 관계 추가
|
|
}
|
|
|
|
model Board {
|
|
uid String @id @default(uuid())
|
|
user_uid String
|
|
category String @default("free")
|
|
title String
|
|
content String
|
|
view Int @default(0)
|
|
recommend Int @default(0)
|
|
status Boolean @default(false)
|
|
at_created DateTime @default(now())
|
|
at_updated DateTime @updatedAt
|
|
author User @relation(fields: [user_uid], references: [uid])
|
|
}
|