main
Some checks failed
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled

This commit is contained in:
Harun CAN
2026-03-09 02:17:10 +03:00
parent 6221137a35
commit 1a6b00478f
28 changed files with 999 additions and 43 deletions

View File

@@ -6,7 +6,7 @@ generator client {
}
datasource db {
provider = "postgresql"
provider = "sqlite"
url = env("DATABASE_URL")
}
@@ -160,3 +160,79 @@ model Translation {
@@index([locale])
@@index([namespace])
}
// ============================================
// CMS - Site Content Management
// ============================================
model Project {
id String @id @default(uuid())
title String
image String
roles String @default("[]") // JSON array stored as string for SQLite
color String @default("#FF5733")
sortOrder Int @default(0)
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
deletedAt DateTime? // Soft delete support
@@index([sortOrder])
}
// ============================================
// Audit Log — CMS İşlem Kayıtları
// ============================================
model AuditLog {
id String @id @default(uuid())
entity String // "project", "client", "content", "media"
entityId String // İlgili kaydın ID'si
action String // "CREATE", "UPDATE", "DELETE", "RESTORE"
before String? // JSON — önceki durum
after String? // JSON — sonraki durum
userId String? // İşlemi yapan kullanıcı
ip String? // İstek IP'si
createdAt DateTime @default(now())
@@index([entity, entityId])
@@index([action])
@@index([createdAt])
}
model SiteContent {
id String @id @default(uuid())
section String // "hero", "services", "process", "about", "contact", "footer", "navbar"
locale String @default("tr")
content String @default("{}") // JSON stored as string for SQLite
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([section, locale])
@@index([section])
@@index([locale])
}
model MediaFile {
id String @id @default(uuid())
filename String
originalName String
mimetype String
path String
url String
size Int
createdAt DateTime @default(now())
}
model Client {
id String @id @default(uuid())
name String
logo String // URL to logo image
website String? // Optional website URL
sortOrder Int @default(0)
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([sortOrder])
}