175 lines
4.2 KiB
Plaintext
175 lines
4.2 KiB
Plaintext
// 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"
|
|
output = "../src/generated/prisma"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model CommissionType {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
sortIndex Int @default(0)
|
|
|
|
name String
|
|
|
|
description String?
|
|
|
|
options CommissionTypeOption[]
|
|
extras CommissionTypeExtra[]
|
|
}
|
|
|
|
model CommissionOption {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
sortIndex Int @default(0)
|
|
|
|
name String @unique
|
|
|
|
description String?
|
|
|
|
types CommissionTypeOption[]
|
|
}
|
|
|
|
model CommissionExtra {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
sortIndex Int @default(0)
|
|
|
|
name String @unique
|
|
|
|
description String?
|
|
|
|
types CommissionTypeExtra[]
|
|
}
|
|
|
|
model CommissionTypeOption {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
sortIndex Int @default(0)
|
|
|
|
typeId String
|
|
optionId String
|
|
|
|
priceRange String?
|
|
pricePercent Float?
|
|
price Float?
|
|
|
|
type CommissionType @relation(fields: [typeId], references: [id])
|
|
option CommissionOption @relation(fields: [optionId], references: [id])
|
|
|
|
@@unique([typeId, optionId])
|
|
}
|
|
|
|
model CommissionTypeExtra {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
sortIndex Int @default(0)
|
|
|
|
typeId String
|
|
extraId String
|
|
|
|
priceRange String?
|
|
pricePercent Float?
|
|
price Float?
|
|
|
|
type CommissionType @relation(fields: [typeId], references: [id])
|
|
extra CommissionExtra @relation(fields: [extraId], references: [id])
|
|
|
|
@@unique([typeId, extraId])
|
|
}
|
|
|
|
// model User {
|
|
// id String @id @default(cuid())
|
|
// email String @unique
|
|
// name String?
|
|
// role Role @default(ADMIN)
|
|
// createdAt DateTime @default(now())
|
|
// }
|
|
|
|
// enum Role {
|
|
// ADMIN
|
|
// ARTIST
|
|
// }
|
|
|
|
// model CommissionType {
|
|
// id String @id @default(cuid())
|
|
// title String
|
|
// description String?
|
|
// basePrice Float
|
|
// deliveryEst String? // e.g. "2 weeks"
|
|
// tags String[] // e.g. shaded, sketch, full-body
|
|
// active Boolean @default(true)
|
|
// createdAt DateTime @default(now())
|
|
// CommissionRequest CommissionRequest[]
|
|
// }
|
|
|
|
// model CommissionRequest {
|
|
// id String @id @default(cuid())
|
|
// name String
|
|
// email String
|
|
// message String
|
|
// typeId String
|
|
// status RequestStatus @default(PENDING)
|
|
// createdAt DateTime @default(now())
|
|
|
|
// type CommissionType @relation(fields: [typeId], references: [id])
|
|
// }
|
|
|
|
// enum RequestStatus {
|
|
// PENDING
|
|
// ACCEPTED
|
|
// IN_PROGRESS
|
|
// DONE
|
|
// REJECTED
|
|
// }
|
|
|
|
// model Artwork {
|
|
// id String @id @default(cuid())
|
|
// title String
|
|
// imageUrl String
|
|
// description String?
|
|
// tags String[]
|
|
// formats String[]
|
|
// isPublic Boolean @default(true)
|
|
// groupId String?
|
|
// createdAt DateTime @default(now())
|
|
|
|
// group PresentationGroup? @relation(fields: [groupId], references: [id])
|
|
// }
|
|
|
|
// model PresentationGroup {
|
|
// id String @id @default(cuid())
|
|
// name String
|
|
// description String?
|
|
// createdAt DateTime @default(now())
|
|
// Artwork Artwork[]
|
|
// }
|
|
|
|
// model Preferences {
|
|
// id String @id @default(cuid())
|
|
// commissionOpen Boolean @default(true)
|
|
// defaultDelivery String? // e.g. "7 days"
|
|
// autoReplyMessage String?
|
|
// notifyByEmail Boolean @default(true)
|
|
// }
|
|
|
|
// model TOS {
|
|
// id String @id @default(cuid())
|
|
// content String // Markdown or rich text
|
|
// createdAt DateTime @default(now())
|
|
// }
|