// 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" } datasource db { provider = "postgresql" url = env("DATABASE_URL") } model User { id String @id @default(uuid()) email String @unique name String? password String createdAt DateTime @default(now()) updatedAt DateTime @updatedAt pages Page[] blocks Block[] } model Page { id String @id @default(uuid()) title String content String? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt userId String user User @relation(fields: [userId], references: [id]) parentId String? parent Page? @relation("PageToPage", fields: [parentId], references: [id]) children Page[] @relation("PageToPage") blocks Block[] } model Block { id String @id @default(uuid()) type String // text, heading, list, image, etc. content String order Int createdAt DateTime @default(now()) updatedAt DateTime @updatedAt pageId String page Page @relation(fields: [pageId], references: [id]) userId String user User @relation(fields: [userId], references: [id]) }