Skip to content

Commit

Permalink
ar(feat) DPCP-13: Get seed to work
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloreale committed Jul 13, 2024
1 parent 61fd7d6 commit 614a077
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 0 additions & 3 deletions prisma/mock/listings.mts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ export const createMockListing = ({ community, user, communityFavorited, favorit
description: {
es: 'Lorem ipsum dolor sit amet consectetur',
},
remarks: {
es: 'Lorem ipsum',
},
status: 'ACTIVE',
location: mockLocation,
favorited: {
Expand Down
2 changes: 1 addition & 1 deletion prisma/mock/taxonomies.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const createMockTerm = ({
es: 'Lorem ipsum dolor sit amet consectetur',
},
status: 'ACTIVE',
type: 'MODALIDADES',
type: 'TAG',
nature: 'SEGMENTED',
targetUsers: {
connect: targetUsers,
Expand Down
1 change: 0 additions & 1 deletion prisma/schema-private.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ model Messages {
type EMessageType
status EMessageStatus
nature EMessageNature
cadence ECadence
channels EMessageChannel[]
title ILocaleString
Expand Down
7 changes: 5 additions & 2 deletions prisma/seed.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const cleanupDatabase = () => {

const seedType = process.argv[2];

let func

if (seedType === 'private') {
console.log('~ SEEDING PRIVATE DB ~');

Expand Down Expand Up @@ -85,7 +87,6 @@ if (seedType === 'private') {
user: user1.id,
community: community1.id,
communityFavorited: [{ id: community2.id }, { id: community3.id }],
model: model1.id,
}),
});
const listing2 = await pvtPrisma.listings.create({
Expand Down Expand Up @@ -154,6 +155,7 @@ if (seedType === 'private') {
throw error;
}
};
func = main
} else {
console.log('~ SEEDING PUBLIC DB ~');

Expand Down Expand Up @@ -270,8 +272,9 @@ if (seedType === 'private') {
throw error;
}
};
func = main
}

main().catch((err) => {
func().catch((err) => {
console.warn('Error While generating Seed: \n', err);
});

0 comments on commit 614a077

Please sign in to comment.