forked from podkrepi-bg/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing concurency in donationWish seeding (podkrepi-bg#570)
* let db create the donationWish primary id * fix: foreach creates problems with async/await, so replaced with sequential for()
- Loading branch information
1 parent
4a6e572
commit 110443f
Showing
2 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { Factory } from 'fishery' | ||
import { faker } from '@faker-js/faker' | ||
import { Prisma } from '@prisma/client' | ||
|
||
import { DonationWish } from '.prisma/client' | ||
|
||
export const donationWishFactory = Factory.define<DonationWish>(({ associations }) => ({ | ||
id: faker.datatype.uuid(), | ||
message: faker.lorem.paragraph(), | ||
campaignId: associations.campaignId || faker.datatype.uuid(), | ||
personId: associations.personId || null, | ||
donationId: associations.donationId || null, | ||
createdAt: faker.date.past(), | ||
updatedAt: faker.date.recent(), | ||
})) | ||
export const donationWishFactory = Factory.define<Prisma.DonationWishUncheckedCreateInput>( | ||
({ associations }) => ({ | ||
message: faker.lorem.paragraph(), | ||
campaignId: associations.campaignId || faker.datatype.uuid(), | ||
personId: associations.personId || null, | ||
donationId: associations.donationId || null, | ||
createdAt: faker.date.past(), | ||
updatedAt: faker.date.recent(), | ||
}), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters