163 lines
3.4 KiB
Plaintext
163 lines
3.4 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
email String @unique
|
|
name String
|
|
password String
|
|
role Role @default(ADMIN)
|
|
avatar String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
// Relations
|
|
blogPosts BlogPost[]
|
|
accounts Account[]
|
|
sessions Session[]
|
|
|
|
@@map("users")
|
|
}
|
|
|
|
model Account {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
type String
|
|
provider String
|
|
providerAccountId String
|
|
refresh_token String?
|
|
access_token String?
|
|
expires_at Int?
|
|
token_type String?
|
|
scope String?
|
|
id_token String?
|
|
session_state String?
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([provider, providerAccountId])
|
|
@@map("accounts")
|
|
}
|
|
|
|
model Session {
|
|
id String @id @default(cuid())
|
|
sessionToken String @unique
|
|
userId String
|
|
expires DateTime
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@map("sessions")
|
|
}
|
|
|
|
model VerificationToken {
|
|
identifier String
|
|
token String @unique
|
|
expires DateTime
|
|
|
|
@@unique([identifier, token])
|
|
@@map("verification_tokens")
|
|
}
|
|
|
|
model Project {
|
|
id String @id @default(cuid())
|
|
title String
|
|
description String?
|
|
thumbnail String
|
|
size Size @default(SMALL)
|
|
embed String?
|
|
video String?
|
|
credits String
|
|
info String
|
|
category String?
|
|
tags String?
|
|
featured Boolean @default(false)
|
|
published Boolean @default(true)
|
|
publishedAt DateTime?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@map("projects")
|
|
}
|
|
|
|
model BlogPost {
|
|
id String @id @default(cuid())
|
|
title String
|
|
slug String @unique
|
|
content String
|
|
excerpt String?
|
|
featuredImage String?
|
|
category String?
|
|
tags String?
|
|
published Boolean @default(false)
|
|
publishedAt DateTime?
|
|
authorId String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
// Relations
|
|
author User @relation(fields: [authorId], references: [id])
|
|
|
|
@@map("blog_posts")
|
|
}
|
|
|
|
model TeamMember {
|
|
id String @id @default(cuid())
|
|
name String
|
|
title String
|
|
quote String?
|
|
image String
|
|
instagram String?
|
|
order Int @default(0)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@map("team_members")
|
|
}
|
|
|
|
model FAQ {
|
|
id String @id @default(cuid())
|
|
question String
|
|
answer String
|
|
order Int @default(0)
|
|
published Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@map("faqs")
|
|
}
|
|
|
|
enum Role {
|
|
ADMIN
|
|
EDITOR
|
|
}
|
|
|
|
enum Size {
|
|
BIG
|
|
SMALL
|
|
}
|
|
|
|
// Site-wide media assets (images/videos) controllable from admin
|
|
enum AssetType {
|
|
IMAGE
|
|
VIDEO
|
|
}
|
|
|
|
model SiteAsset {
|
|
id String @id @default(cuid())
|
|
key String @unique // e.g., "home.hero.image"
|
|
label String // Human-friendly name
|
|
type AssetType
|
|
url String
|
|
alt String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@map("site_assets")
|
|
}
|