diff --git a/scripts/seed-bot-forum.mjs b/scripts/seed-bot-forum.mjs index 405922e..34e53dc 100644 --- a/scripts/seed-bot-forum.mjs +++ b/scripts/seed-bot-forum.mjs @@ -162,19 +162,32 @@ async function createIndustryCategories() { }); console.log(` + ${cat.name}`); } else { - if (!childCat.parentId) { - await prisma.forumCategory.update({ - where: { id: childCat.id }, - data: { parentId: parent.id }, - }); - } - console.log(` ✓ ${cat.name} (exists)`); + await prisma.forumCategory.update({ + where: { id: childCat.id }, + data: { + name: cat.name, + icon: cat.icon, + description: cat.description, + sortOrder: cat.sortOrder, + parentId: parent.id, + }, + }); + console.log(` ↻ ${cat.name} (updated)`); } const existingSlugs = new Set(childCat.children.map(c => c.slug)); for (const sub of cat.children) { if (existingSlugs.has(sub.slug)) { - console.log(` - ${sub.name} (exists)`); + await prisma.forumCategory.update({ + where: { slug: sub.slug }, + data: { + name: sub.name, + icon: sub.icon, + description: sub.description, + parentId: childCat.id, + }, + }); + console.log(` ↻ ${sub.name} (updated)`); } else { const conflictSlug = await prisma.forumCategory.findUnique({ where: { slug: sub.slug },