Skip to content

Commit

Permalink
add user back reference error
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Nov 10, 2023
1 parent dc8f5b1 commit bc4191c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions generators/base-application/support/prepare-relationship.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ export default function prepareRelationship(entityWithConfig, relationship, gene
entityWithConfig.databaseType !== DATABASE_NO &&
(relationship.relationshipType === 'one-to-many' || relationship.ownerSide === false)
) {
if (otherEntityData.builtInUser) {
throw new Error(`Error at entity ${entityName}: relationships with built-in User cannot have back reference`);
}
throw new Error(
`Error at entity ${entityName}: could not find the other side of the relationship ${stringifyApplicationData(relationship)}`,
);
Expand Down

0 comments on commit bc4191c

Please sign in to comment.