Fix app-store seeding (#3693)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
pull/3698/head^2
Hariom Balhara 2022-08-04 19:45:23 +05:30 committed by GitHub
parent ca7a78dcda
commit 2aee450c0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

View File

@ -17,6 +17,18 @@ async function seedAppData() {
console.log(`Skipping Routing Form - Form Seed, "Seeded Form - Pro" already exists`); console.log(`Skipping Routing Form - Form Seed, "Seeded Form - Pro" already exists`);
return; return;
} }
const proUser = await prisma.user.findFirst({
where: {
username: "pro",
},
});
if (!proUser) {
console.log(`Skipping Routing Form - Seeding - Pro User not found`);
return;
}
await prisma.app_RoutingForms_Form.create({ await prisma.app_RoutingForms_Form.create({
data: { data: {
id: "948ae412-d995-4865-875a-48302588de03", id: "948ae412-d995-4865-875a-48302588de03",
@ -242,3 +254,12 @@ export default async function main() {
await seedAppData(); await seedAppData();
} }
main()
.catch((e) => {
console.error(e);
process.exit(1);
})
.finally(async () => {
await prisma.$disconnect();
});