main
This commit is contained in:
@@ -370,6 +370,19 @@ async function seedPartnerShops() {
|
||||
});
|
||||
}
|
||||
|
||||
async function seedBanners() {
|
||||
// 기존 배너 정리 후 5개만 채움
|
||||
await prisma.banner.deleteMany({});
|
||||
const items = Array.from({ length: 5 }).map((_, i) => ({
|
||||
title: `메인 배너 ${i + 1}`,
|
||||
imageUrl: "/sample.jpg",
|
||||
linkUrl: "/",
|
||||
sortOrder: i + 1,
|
||||
active: true,
|
||||
}));
|
||||
await prisma.banner.createMany({ data: items });
|
||||
}
|
||||
|
||||
async function main() {
|
||||
await upsertRoles();
|
||||
const admin = await upsertAdmin();
|
||||
@@ -380,6 +393,7 @@ async function main() {
|
||||
const boards = await upsertBoards(admin, categoryMap);
|
||||
await createPostsForAllBoards(boards, 100, admin);
|
||||
await seedPartnerShops();
|
||||
await seedBanners();
|
||||
|
||||
await seedPolicies();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user