From 9f921829ca04096d4c42fea99d33973f752b7fc6 Mon Sep 17 00:00:00 2001 From: blinko Date: Sat, 26 Oct 2024 17:33:11 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9Efix:=20build=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prisma/seed.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/prisma/seed.ts b/prisma/seed.ts index d0098cc..53b82d1 100644 --- a/prisma/seed.ts +++ b/prisma/seed.ts @@ -196,19 +196,22 @@ const prisma = new PrismaClient(); async function main() { const hasNotes = await prisma.notes.findMany(); if (hasNotes.length == 0) { - await prisma.notes.createMany({ data: notes }) + const noteRes = await prisma.notes.createManyAndReturn({ data: notes }) await prisma.tag.createMany({ data: tag }) await prisma.tagsToNote.createMany({ data: tagsToNote }) await prisma.attachments.createMany({ data: attachments }) + return noteRes } } main() + .then(e => { + console.log(e) + console.log("✨ Seed done! ✨") + }) .catch((e) => { console.error(e); - process.exit(1); }) .finally(async () => { await prisma.$disconnect(); - process.exit(1); }); \ No newline at end of file