From 97437dbdec1ed4a36642446e6a40c416e61b08f3 Mon Sep 17 00:00:00 2001 From: Lucas Araujo Date: Mon, 11 Oct 2021 14:38:54 -0300 Subject: [PATCH] Add project fork to seed file --- 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, + }, + }, + }, + }) } -- 2.39.5