Add blog categories and default SUPER_ADMIN store scope to Mana Collection.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
3da8a5d4a2
commit
20e81ade19
+29
-8
@@ -126,6 +126,7 @@ model Store {
|
||||
|
||||
products Product[]
|
||||
categories Category[]
|
||||
blogCategories BlogCategory[]
|
||||
brands Brand[]
|
||||
blogs BlogPost[]
|
||||
orderItems OrderItem[]
|
||||
@@ -219,24 +220,44 @@ model ProductVariant {
|
||||
@@index([productId])
|
||||
}
|
||||
|
||||
model BlogCategory {
|
||||
id String @id @default(cuid())
|
||||
storeId String
|
||||
store Store @relation(fields: [storeId], references: [id], onDelete: Cascade)
|
||||
parentId String?
|
||||
parent BlogCategory? @relation("BlogCategoryTree", fields: [parentId], references: [id], onDelete: SetNull)
|
||||
children BlogCategory[] @relation("BlogCategoryTree")
|
||||
nameFa String
|
||||
nameEn String @default("")
|
||||
sortOrder Int @default(0)
|
||||
blogs BlogPost[]
|
||||
|
||||
@@index([storeId])
|
||||
@@index([parentId])
|
||||
@@index([sortOrder])
|
||||
}
|
||||
|
||||
model BlogPost {
|
||||
id String @id @default(cuid())
|
||||
id String @id @default(cuid())
|
||||
storeId String
|
||||
store Store @relation(fields: [storeId], references: [id], onDelete: Cascade)
|
||||
store Store @relation(fields: [storeId], references: [id], onDelete: Cascade)
|
||||
categoryId String?
|
||||
category BlogCategory? @relation(fields: [categoryId], references: [id], onDelete: SetNull)
|
||||
title String
|
||||
summary String @default("")
|
||||
body String @default("")
|
||||
author String @default("")
|
||||
summary String @default("")
|
||||
body String @default("")
|
||||
author String @default("")
|
||||
imageUrl String?
|
||||
imageKey String?
|
||||
published Boolean @default(true)
|
||||
published Boolean @default(true)
|
||||
metaTitle String?
|
||||
metaDescription String?
|
||||
slug String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([storeId])
|
||||
@@index([categoryId])
|
||||
@@index([published])
|
||||
@@index([slug])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user