Skip to content

Commit

Permalink
Remove second iterate from the seed query
Browse files Browse the repository at this point in the history
  • Loading branch information
iPegii committed Jun 26, 2023
1 parent 7ab7f28 commit 103614c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions server/scripts/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,15 @@ const seedFacultiesAndStudyprogrammes = async () => {
for (const { code } of data) {
const studyprogramme = await db.studyprogramme.findOne({ where: { key: code } })

for (const { id, key } of studyprogramme) {
await db.studyprogrammesLocked.create({
key,
studyprogrammeId: id,
locked: {
yearly: false,
evaluation: false,
'degree-reform': false,
},
})
}
await db.studyprogrammesLocked.create({
key: studyprogramme.key,
studyprogrammeId: studyprogramme.id,
locked: {
yearly: false,
evaluation: false,
'degree-reform': false,
},
})
}
}

Expand Down

0 comments on commit 103614c

Please sign in to comment.