feat: 增加管理员品牌归属关系

This commit is contained in:
que01 committed 2026-09-23 02:10:19 +08:00
1 parent fef0a890ad
commit ee3bd9051b
4 files changed
+52 -2

No files matched your search

+6 -1
View File
@@ -59,7 +59,7 @@ async function main(): Promise<void> {
create: { brandId: brand.id, name, isPreset: true },
});
}
await prisma.adminUser.upsert({
const admin = await prisma.adminUser.upsert({
where: { username: "admin" },
update: {},
create: {
@@ -68,6 +68,11 @@ async function main(): Promise<void> {
displayName: "品牌管理员",
},
});
await prisma.brandMembership.upsert({
where: { adminUserId_brandId: { adminUserId: admin.id, brandId: brand.id } },
update: { isEnabled: true, role: "owner" },
create: { adminUserId: admin.id, brandId: brand.id, role: "owner" },
});
}
main().finally(() => prisma.$disconnect());