Skip to content

Commit

Permalink
MetadataMapper: don't create duplicate association if already mapped
Browse files Browse the repository at this point in the history
  • Loading branch information
steveschmitt committed Nov 9, 2020
1 parent d3ef10b commit fc5f346
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions breeze-sequelize/src/MetadataMapper.ts
Expand Up @@ -89,6 +89,10 @@ export class MetadataMapper {
const sqModel = entityTypeSqModelMap[entityType.name];
navProps.forEach(np => {
const npName = np.nameOnServer;
if (sqModel.associations[npName]) {
// already mapped
return;
}

const targetEntityType = np.entityType;
const targetSqModel = entityTypeSqModelMap[targetEntityType.name];
Expand Down

0 comments on commit fc5f346

Please sign in to comment.