From 6c093e65bf13c2f3d899db6ab6d923226a4cac58 Mon Sep 17 00:00:00 2001 From: Lucas Barros Date: Mon, 11 Oct 2021 15:54:08 -0300 Subject: [PATCH] Add project fork to seed file (#552) --- app/api/db/seed.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/api/db/seed.js b/app/api/db/seed.js index 7b26e70..d8ab0ba 100644 --- a/app/api/db/seed.js +++ b/app/api/db/seed.js @@ -80,9 +80,21 @@ async function main() { } existing = await db.project.findMany({where: { title: projects[1].title}}) if(!existing.length) { - await db.project.create({ + const result = await db.project.create({ data: projects[1], }) + + await db.project.create({ + data: { + ...projects[1], + title: `${projects[1].title} fork`, + forkedFrom: { + connect: { + id: result.id, + }, + }, + }, + }) }