model Page {
id Int @id @default(autoincrement())
title String
description String?
published Boolean @default(false)
order Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
contents Content[]
}
model Content {
id Int @id @default(autoincrement())
title String
subtitle String?
body String
link String?
image String?
pageId Int
page Page @relation(fields: [pageId], references: [id])
tags Tag[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Tag {
id Int @id @default(autoincrement())
name String
contentId Int
content Content @relation(fields: [contentId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
Set up database using the Prisma schema
chatgpt prompt result