Skip to content

Commit

Permalink
fix(tools): fix seed script on new Prisma version
Browse files Browse the repository at this point in the history
  • Loading branch information
tsa96 committed Jan 9, 2024
1 parent d58cd09 commit 691a2fc
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions libs/db/src/scripts/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,24 +482,25 @@ prismaWrapper(async (prisma: PrismaClient) => {
}
});

await prisma.activity.createMany({
data: [
{
await prisma.activity.create({
data: {
userID: map.submitterID,
type: ActivityType.MAP_UPLOADED,
data: map.id,
...Random.createdUpdatedDates()
}
});

if (map.status === MapStatusNew.APPROVED) {
await prisma.activity.create({
data: {
userID: map.submitterID,
type: ActivityType.MAP_UPLOADED,
data: map.id,
...Random.createdUpdatedDates()
},
map.status === MapStatusNew.APPROVED
? {
userID: map.submitterID,
type: ActivityType.MAP_APPROVED,
data: map.id,
...Random.createdUpdatedDates()
}
: undefined
]
});
}
});
}

//#region Leaderboards

Expand Down

0 comments on commit 691a2fc

Please sign in to comment.