From b2d641322119e4e51ff8d0242cf444b4a7f5563f Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 16 Jan 2025 21:06:44 +0000 Subject: [PATCH] fix(scripts): remove `categoryId` when importing questions --- scripts/import.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/import.mjs b/scripts/import.mjs index 1d9d58c64..718507a7a 100644 --- a/scripts/import.mjs +++ b/scripts/import.mjs @@ -85,7 +85,12 @@ for (const category of dump.categories) { const original_id = category.id; delete category.id; delete category.guildId; - category.questions = { create: category.questions }; + category.questions = { + create: category.questions.map(question => { + delete question.categoryId; + return question; + }), + }; const { id: new_id } = await prisma.category.create({ data: { ...category,