sunnymh/prisma/schema.prisma
yiekheng 4f5d74e1c8 Squashed 'manga-site/' content from commit f2ef775
git-subtree-dir: manga-site
git-subtree-split: f2ef775f7095dc2b107b576cd4053593e89dd887
2026-04-12 18:47:51 +08:00

50 lines
1.0 KiB
Plaintext

generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Manga {
id Int @id @default(autoincrement())
title String
description String
coverUrl String
slug String @unique
genre String @default("Drama")
status Status @default(PUBLISHED)
chapters Chapter[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Chapter {
id Int @id @default(autoincrement())
mangaId Int
number Int
title String
pages Page[]
manga Manga @relation(fields: [mangaId], references: [id])
@@unique([mangaId, number])
}
model Page {
id Int @id @default(autoincrement())
chapterId Int
number Int
imageUrl String
width Int @default(0)
height Int @default(0)
chapter Chapter @relation(fields: [chapterId], references: [id])
@@unique([chapterId, number])
}
enum Status {
PUBLISHED
DRAFT
}