feat: 增加能力插件安装模型
This commit is contained in:
1 parent
3bc19c36a7
commit
21c40b8e10
3 files changed
+31
No files matched your search
@@ -0,0 +1,14 @@
|
||||
CREATE TABLE "CapabilityInstallation" (
|
||||
"id" TEXT NOT NULL,
|
||||
"brandId" TEXT NOT NULL,
|
||||
"capabilityKey" TEXT NOT NULL,
|
||||
"capabilityVersion" TEXT NOT NULL,
|
||||
"status" TEXT NOT NULL DEFAULT 'enabled',
|
||||
"config" JSONB,
|
||||
"installedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
CONSTRAINT "CapabilityInstallation_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
CREATE UNIQUE INDEX "CapabilityInstallation_brandId_capabilityKey_key" ON "CapabilityInstallation"("brandId", "capabilityKey");
|
||||
CREATE INDEX "CapabilityInstallation_brandId_status_idx" ON "CapabilityInstallation"("brandId", "status");
|
||||
ALTER TABLE "CapabilityInstallation" ADD CONSTRAINT "CapabilityInstallation_brandId_fkey" FOREIGN KEY ("brandId") REFERENCES "BrandProfile"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -58,6 +58,21 @@ model BrandProfile {
|
||||
offerings Offering[]
|
||||
inquiryForms InquiryForm[]
|
||||
inquirySubmissions InquirySubmission[]
|
||||
capabilityInstallations CapabilityInstallation[]
|
||||
}
|
||||
|
||||
model CapabilityInstallation {
|
||||
id String @id @default(uuid())
|
||||
brandId String
|
||||
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
||||
capabilityKey String
|
||||
capabilityVersion String
|
||||
status String @default("enabled")
|
||||
config Json?
|
||||
installedAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@unique([brandId, capabilityKey])
|
||||
@@index([brandId, status])
|
||||
}
|
||||
|
||||
model BrandTemplateInstallation {
|
||||
|
||||
Reference in new issue
Block a user