feat: 增加管理员品牌归属关系
This commit is contained in:
1 parent
fef0a890ad
commit
ee3bd9051b
4 files changed
+52
-2
No files matched your search
@@ -60,6 +60,7 @@ model BrandProfile {
|
||||
inquirySubmissions InquirySubmission[]
|
||||
capabilityInstallations CapabilityInstallation[]
|
||||
capabilityAuditLogs CapabilityAuditLog[]
|
||||
adminMemberships BrandMembership[]
|
||||
}
|
||||
|
||||
model CapabilityInstallation {
|
||||
@@ -327,6 +328,21 @@ model AdminUser {
|
||||
lastLoginAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
memberships BrandMembership[]
|
||||
}
|
||||
|
||||
model BrandMembership {
|
||||
id String @id @default(uuid())
|
||||
adminUserId String
|
||||
brandId String
|
||||
role String @default("admin")
|
||||
isEnabled Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
adminUser AdminUser @relation(fields: [adminUserId], references: [id], onDelete: Cascade)
|
||||
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
||||
@@unique([adminUserId, brandId])
|
||||
@@index([brandId, isEnabled])
|
||||
}
|
||||
|
||||
model BookingTag {
|
||||
|
||||
Reference in new issue
Block a user