stuff done
This commit is contained in:
32
lib/db/prisma/schema/entity.prisma
Normal file
32
lib/db/prisma/schema/entity.prisma
Normal file
@@ -0,0 +1,32 @@
|
||||
model Entity {
|
||||
id Int @id @default(autoincrement())
|
||||
type EntityType
|
||||
published Boolean? @default(false)
|
||||
scopes Json?
|
||||
position Int? @default(0) @db.UnsignedSmallInt
|
||||
slug String? @db.VarChar(512)
|
||||
media String? @db.VarChar(512)
|
||||
storeId Int @default(1) @map("store_id")
|
||||
locales EntityLocale[]
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3)
|
||||
updatedAt DateTime? @default(dbgenerated("NULL DEFAULT NULL ON UPDATE current_timestamp(3)")) @map("updated_at") @db.Timestamp(3)
|
||||
|
||||
@@unique([storeId, type, slug])
|
||||
@@map("entities")
|
||||
}
|
||||
|
||||
model EntityLocale {
|
||||
id Int @id @default(autoincrement())
|
||||
lang Lang @default(uk)
|
||||
slug String? @db.VarChar(512)
|
||||
title String @db.VarChar(384)
|
||||
annotation String? @db.MediumText
|
||||
body String? @db.MediumText
|
||||
entity Entity @relation(fields: [entityId], references: [id], onDelete: Cascade)
|
||||
entityId Int @map("entity_id")
|
||||
meta Meta? @relation(fields: [metaId], references: [id], onDelete: Cascade)
|
||||
metaId Int? @map("meta_id")
|
||||
|
||||
@@unique([slug, lang])
|
||||
@@map("entity_locale")
|
||||
}
|
||||
Reference in New Issue
Block a user