Add project fork to seed file (#552)
This commit was merged in pull request #552.
This commit is contained in:
@@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user