feat: 收口模板升级与阶段七持续回归
This commit is contained in:
1 parent
ec16fff70e
commit
71c528de34
29 files changed
+1962
-304
No files matched your search
+16
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE "TemplateOperationFailureEvent" (
|
||||
"id" TEXT NOT NULL,
|
||||
"action" TEXT NOT NULL,
|
||||
"resultCode" TEXT NOT NULL,
|
||||
"requestId" TEXT,
|
||||
"actorId" TEXT,
|
||||
"brandId" TEXT,
|
||||
"packageKey" TEXT,
|
||||
"version" TEXT,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "TemplateOperationFailureEvent_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
CREATE INDEX "TemplateOperationFailureEvent_createdAt_action_idx" ON "TemplateOperationFailureEvent"("createdAt", "action");
|
||||
CREATE INDEX "TemplateOperationFailureEvent_packageKey_createdAt_idx" ON "TemplateOperationFailureEvent"("packageKey", "createdAt");
|
||||
@@ -112,25 +112,25 @@ enum MiniAppReleaseStatus {
|
||||
}
|
||||
|
||||
model MiniAppReleaseTask {
|
||||
id String @id @default(uuid())
|
||||
id String @id @default(uuid())
|
||||
brandId String
|
||||
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
||||
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
||||
releaseId String?
|
||||
release BrandRelease? @relation(fields: [releaseId], references: [id], onDelete: SetNull)
|
||||
release BrandRelease? @relation(fields: [releaseId], references: [id], onDelete: SetNull)
|
||||
version Int
|
||||
status MiniAppReleaseStatus @default(built)
|
||||
status MiniAppReleaseStatus @default(built)
|
||||
artifactPath String?
|
||||
buildLogs Json?
|
||||
buildStatus MiniAppBuildStatus @default(idle)
|
||||
uploadStatus MiniAppUploadStatus @default(idle)
|
||||
reviewStatus MiniAppReviewStatus @default(not_submitted)
|
||||
buildStatus MiniAppBuildStatus @default(idle)
|
||||
uploadStatus MiniAppUploadStatus @default(idle)
|
||||
reviewStatus MiniAppReviewStatus @default(not_submitted)
|
||||
actorId String
|
||||
error String?
|
||||
weappUploadId String?
|
||||
audit Json?
|
||||
attempts MiniAppReleaseAttempt[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([brandId, version])
|
||||
@@index([brandId, createdAt])
|
||||
@@ -171,7 +171,7 @@ enum MiniAppAttemptStatus {
|
||||
}
|
||||
|
||||
model MiniAppReleaseAttempt {
|
||||
id String @id @default(uuid())
|
||||
id String @id @default(uuid())
|
||||
taskId String
|
||||
task MiniAppReleaseTask @relation(fields: [taskId], references: [id], onDelete: Cascade)
|
||||
brandId String
|
||||
@@ -179,17 +179,17 @@ model MiniAppReleaseAttempt {
|
||||
phase MiniAppAttemptPhase
|
||||
attempt Int
|
||||
status MiniAppAttemptStatus @default(running)
|
||||
leaseToken String @unique
|
||||
leaseToken String @unique
|
||||
leaseExpiresAt DateTime
|
||||
startedAt DateTime @default(now())
|
||||
heartbeatAt DateTime @default(now())
|
||||
startedAt DateTime @default(now())
|
||||
heartbeatAt DateTime @default(now())
|
||||
finishedAt DateTime?
|
||||
artifactPath String?
|
||||
externalId String?
|
||||
error String?
|
||||
logs Json?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([taskId, phase, attempt])
|
||||
@@index([brandId, taskId, phase, status])
|
||||
@@ -223,19 +223,19 @@ model CapabilityAuditLog {
|
||||
}
|
||||
|
||||
model BrandTemplateInstallation {
|
||||
id String @id @default(uuid())
|
||||
id String @id @default(uuid())
|
||||
brandId String
|
||||
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
||||
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
||||
templateKey String
|
||||
templateVersion String @default("1.0.0")
|
||||
templateVersion String @default("1.0.0")
|
||||
visualTemplateKey String?
|
||||
templatePackageVersionId String?
|
||||
templatePackageVersion TemplatePackageVersion? @relation("BrandTemplateInstallationPackageVersion", fields: [templatePackageVersionId], references: [id], onDelete: SetNull)
|
||||
templatePackageVersion TemplatePackageVersion? @relation("BrandTemplateInstallationPackageVersion", fields: [templatePackageVersionId], references: [id], onDelete: SetNull)
|
||||
contentChecksum String?
|
||||
configSnapshot Json
|
||||
previousSnapshots Json @default("[]")
|
||||
installedAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
previousSnapshots Json @default("[]")
|
||||
installedAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([brandId, templateKey])
|
||||
@@index([brandId])
|
||||
@@ -453,52 +453,52 @@ model Tag {
|
||||
}
|
||||
|
||||
model AdminUser {
|
||||
id String @id @default(uuid())
|
||||
username String @unique
|
||||
passwordHash String
|
||||
displayName String
|
||||
role String @default("admin")
|
||||
platformTemplateRole PlatformTemplateRole @default(none)
|
||||
isEnabled Boolean @default(true)
|
||||
mustChangePassword Boolean @default(false)
|
||||
lastLoginAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
memberships BrandMembership[]
|
||||
importedTemplateVersions TemplatePackageVersion[] @relation("TemplatePackageImportedBy")
|
||||
templateAuditLogs TemplatePackageAuditLog[] @relation("TemplatePackageAuditActor")
|
||||
id String @id @default(uuid())
|
||||
username String @unique
|
||||
passwordHash String
|
||||
displayName String
|
||||
role String @default("admin")
|
||||
platformTemplateRole PlatformTemplateRole @default(none)
|
||||
isEnabled Boolean @default(true)
|
||||
mustChangePassword Boolean @default(false)
|
||||
lastLoginAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
memberships BrandMembership[]
|
||||
importedTemplateVersions TemplatePackageVersion[] @relation("TemplatePackageImportedBy")
|
||||
templateAuditLogs TemplatePackageAuditLog[] @relation("TemplatePackageAuditActor")
|
||||
}
|
||||
|
||||
model TemplatePackage {
|
||||
id String @id @default(uuid())
|
||||
packageKey String @unique
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
versions TemplatePackageVersion[]
|
||||
id String @id @default(uuid())
|
||||
packageKey String @unique
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
versions TemplatePackageVersion[]
|
||||
}
|
||||
|
||||
model TemplatePackageVersion {
|
||||
id String @id @default(uuid())
|
||||
id String @id @default(uuid())
|
||||
templatePackageId String
|
||||
templatePackage TemplatePackage @relation(fields: [templatePackageId], references: [id], onDelete: Cascade)
|
||||
packageKey String
|
||||
version String
|
||||
displayName String
|
||||
templatePackage TemplatePackage @relation(fields: [templatePackageId], references: [id], onDelete: Cascade)
|
||||
packageKey String
|
||||
version String
|
||||
displayName String
|
||||
visualTemplateKey String?
|
||||
status TemplatePackageVersionStatus @default(imported)
|
||||
manifestSnapshot Json
|
||||
validationReport Json
|
||||
contentChecksum String
|
||||
archiveChecksum String
|
||||
artifactPath String
|
||||
importedById String
|
||||
importedBy AdminUser @relation("TemplatePackageImportedBy", fields: [importedById], references: [id], onDelete: Restrict)
|
||||
auditLogs TemplatePackageAuditLog[]
|
||||
installations BrandTemplateInstallation[] @relation("BrandTemplateInstallationPackageVersion")
|
||||
bootstrapImports TemplateBootstrapImport[]
|
||||
importedAt DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
status TemplatePackageVersionStatus @default(imported)
|
||||
manifestSnapshot Json
|
||||
validationReport Json
|
||||
contentChecksum String
|
||||
archiveChecksum String
|
||||
artifactPath String
|
||||
importedById String
|
||||
importedBy AdminUser @relation("TemplatePackageImportedBy", fields: [importedById], references: [id], onDelete: Restrict)
|
||||
auditLogs TemplatePackageAuditLog[]
|
||||
installations BrandTemplateInstallation[] @relation("BrandTemplateInstallationPackageVersion")
|
||||
bootstrapImports TemplateBootstrapImport[]
|
||||
importedAt DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([templatePackageId, version])
|
||||
@@index([packageKey, status])
|
||||
@@ -506,20 +506,20 @@ model TemplatePackageVersion {
|
||||
}
|
||||
|
||||
model TemplateBootstrapImport {
|
||||
id String @id @default(uuid())
|
||||
id String @id @default(uuid())
|
||||
brandId String
|
||||
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
||||
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
||||
templatePackageVersionId String
|
||||
templatePackageVersion TemplatePackageVersion @relation(fields: [templatePackageVersionId], references: [id], onDelete: Restrict)
|
||||
templatePackageVersion TemplatePackageVersion @relation(fields: [templatePackageVersionId], references: [id], onDelete: Restrict)
|
||||
packageKey String
|
||||
packageVersion String
|
||||
contentChecksum String
|
||||
actorId String
|
||||
strategy String @default("missing_only")
|
||||
strategy String @default("missing_only")
|
||||
status String
|
||||
result Json?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([brandId, createdAt])
|
||||
@@index([templatePackageVersionId, createdAt])
|
||||
@@ -527,22 +527,37 @@ model TemplateBootstrapImport {
|
||||
}
|
||||
|
||||
model TemplatePackageAuditLog {
|
||||
id String @id @default(uuid())
|
||||
id String @id @default(uuid())
|
||||
templatePackageVersionId String
|
||||
templatePackageVersion TemplatePackageVersion @relation(fields: [templatePackageVersionId], references: [id], onDelete: Cascade)
|
||||
actorId String
|
||||
actor AdminUser @relation("TemplatePackageAuditActor", fields: [actorId], references: [id], onDelete: Restrict)
|
||||
action String
|
||||
fromStatus TemplatePackageVersionStatus?
|
||||
toStatus TemplatePackageVersionStatus?
|
||||
requestId String?
|
||||
metadata Json?
|
||||
createdAt DateTime @default(now())
|
||||
templatePackageVersion TemplatePackageVersion @relation(fields: [templatePackageVersionId], references: [id], onDelete: Cascade)
|
||||
actorId String
|
||||
actor AdminUser @relation("TemplatePackageAuditActor", fields: [actorId], references: [id], onDelete: Restrict)
|
||||
action String
|
||||
fromStatus TemplatePackageVersionStatus?
|
||||
toStatus TemplatePackageVersionStatus?
|
||||
requestId String?
|
||||
metadata Json?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([templatePackageVersionId, createdAt])
|
||||
@@index([actorId, createdAt])
|
||||
}
|
||||
|
||||
model TemplateOperationFailureEvent {
|
||||
id String @id @default(uuid())
|
||||
action String
|
||||
resultCode String
|
||||
requestId String?
|
||||
actorId String?
|
||||
brandId String?
|
||||
packageKey String?
|
||||
version String?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([createdAt, action])
|
||||
@@index([packageKey, createdAt])
|
||||
}
|
||||
|
||||
model BrandMembership {
|
||||
id String @id @default(uuid())
|
||||
adminUserId String
|
||||
|
||||
Reference in new issue
Block a user