Skip to content

Commit 13e4ac4

Browse files
HCK-12556: Technical name property in relationships with coupling and naming convention (#65)
1 parent e2ec19c commit 13e4ac4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

forward_engineering/helpers/forwardEngineeringHelper.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const forwardEngineeringHelper = {
4242
if (branchData.relationship && branchData.child) {
4343
let parentName = branchData.parent.collectionName;
4444
let childName = branchData.child.collectionName;
45-
let relationshipName = branchData.relationship.name;
45+
let relationshipName = branchData.relationship.code || branchData.relationship.name;
4646
let relationshipData = '';
4747

4848
const isParentActivated = _.get(branchData, 'parent.isActivated', true);
@@ -293,7 +293,11 @@ const forwardEngineeringHelper = {
293293
result.push(
294294
this.commentIfDeactivated(
295295
getExistsConstraint(
296-
{ labelName: relationship.name, fieldName, type: 'relationship' },
296+
{
297+
labelName: relationship.code || relationship.name,
298+
fieldName,
299+
type: 'relationship',
300+
},
297301
dbVersion,
298302
),
299303
isFieldActivated && isRelationshipActivated,

0 commit comments

Comments
 (0)