- Replace fabricated 12-year/500+/8+ team experience claims with 2026 founding, first-client co-creation, professional team wording - Remove fake case studies and unverified certifications from seeds, cases page, products and ERP upgrade page - Enable Next.js standalone output and production hybrid deployment (Dockerfile.prod, docker-compose.server.yml, Nginx nextjs upstream) - Add linux-musl Prisma engine target and production crypto key build - Sync production CMS database with cleaned seed content
172 lines
4.7 KiB
Plaintext
172 lines
4.7 KiB
Plaintext
generator client {
|
|
provider = "prisma-client"
|
|
output = "../src/generated/prisma"
|
|
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
username String @unique
|
|
password String
|
|
nickname String @default("")
|
|
avatar String @default("")
|
|
email String @default("")
|
|
phone String @default("")
|
|
status Int @default(1)
|
|
role String @default("admin")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
roles UserRole[]
|
|
}
|
|
|
|
model Role {
|
|
id String @id @default(cuid())
|
|
code String @unique
|
|
name String
|
|
description String @default("")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
permissions Permission[]
|
|
users UserRole[]
|
|
}
|
|
|
|
model Permission {
|
|
id String @id @default(cuid())
|
|
roleCode String
|
|
modelCode String
|
|
action String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
role Role @relation(fields: [roleCode], references: [code], onDelete: Cascade)
|
|
|
|
@@unique([roleCode, modelCode, action])
|
|
@@index([modelCode])
|
|
@@index([action])
|
|
}
|
|
|
|
model UserRole {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
roleCode String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
role Role @relation(fields: [roleCode], references: [code], onDelete: Cascade)
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([userId, roleCode])
|
|
@@index([userId])
|
|
}
|
|
|
|
model ContentModel {
|
|
id String @id @default(cuid())
|
|
code String @unique
|
|
name String
|
|
description String @default("")
|
|
fields String
|
|
isPageType Boolean @default(false)
|
|
urlPattern String @default("")
|
|
hasVersions Boolean @default(false)
|
|
hasDraft Boolean @default(false)
|
|
icon String @default("")
|
|
sortOrder Int @default(0)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
items ContentItem[]
|
|
}
|
|
|
|
model ContentItem {
|
|
id String @id @default(cuid())
|
|
modelId String
|
|
modelCode String
|
|
title String
|
|
slug String @default("")
|
|
locale String @default("zh-CN")
|
|
status String @default("draft")
|
|
data String
|
|
version Int @default(1)
|
|
sortOrder Int @default(0)
|
|
publishedAt DateTime?
|
|
createdBy String @default("system")
|
|
updatedBy String @default("system")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
model ContentModel @relation(fields: [modelId], references: [id])
|
|
|
|
@@unique([modelCode, slug, locale])
|
|
@@index([modelCode])
|
|
@@index([status])
|
|
@@index([locale])
|
|
}
|
|
|
|
model ContentZone {
|
|
id String @id @default(cuid())
|
|
code String @unique
|
|
name String
|
|
description String @default("")
|
|
pageCode String @default("")
|
|
zoneKey String @default("")
|
|
allowedModels String @default("[]")
|
|
items String @default("[]")
|
|
settings String @default("{}")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@index([pageCode])
|
|
}
|
|
|
|
model MediaAsset {
|
|
id String @id @default(cuid())
|
|
name String
|
|
path String
|
|
url String
|
|
mimeType String
|
|
size Int @default(0)
|
|
width Int @default(0)
|
|
height Int @default(0)
|
|
alt String @default("")
|
|
storageType String @default("local")
|
|
derivatives String @default("{}")
|
|
createdBy String @default("system")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Notification {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
type String
|
|
title String
|
|
message String
|
|
relatedItemId String @default("")
|
|
relatedModelCode String @default("")
|
|
read Boolean @default(false)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@index([userId])
|
|
@@index([read])
|
|
@@index([createdAt])
|
|
}
|
|
|
|
model AuditLog {
|
|
id String @id @default(cuid())
|
|
module String
|
|
targetId String
|
|
action String
|
|
operator String
|
|
beforeData String @default("{}")
|
|
afterData String @default("{}")
|
|
ip String @default("")
|
|
userAgent String @default("")
|
|
createdAt DateTime @default(now())
|
|
|
|
@@index([module])
|
|
@@index([targetId])
|
|
@@index([createdAt])
|
|
}
|