refactor: 统一模板契约并修复预览版本
This commit is contained in:
1 parent
cd2992c00a
commit
50b87e48de
56 files changed
+7849
-5756
No files matched your search
@@ -10,8 +10,14 @@ const prisma = new PrismaClient();
|
||||
const note = "餐饮主理人原型视觉槽位迁移 v1";
|
||||
try {
|
||||
const brand = await prisma.brandProfile.findUniqueOrThrow({ where: { slug: "default-brand" } });
|
||||
const config = (brand.config ?? {}) as Record<string, unknown>;
|
||||
if (brand.templateKey !== "food" || config.visualTemplateKey !== "acheng-campus-food")
|
||||
const installation = await prisma.brandTemplateInstallation.findUnique({
|
||||
where: { brandId: brand.id },
|
||||
include: { templatePackageVersion: true },
|
||||
});
|
||||
if (
|
||||
brand.templateKey !== "food" ||
|
||||
installation?.templatePackageVersion?.packageKey !== "acheng-campus-food"
|
||||
)
|
||||
throw new Error("Migration is restricted to the development food brand");
|
||||
const previous = await prisma.brandRelease.findFirst({
|
||||
where: { brandId: brand.id },
|
||||
|
||||
Reference in new issue
Block a user