Skip to content

Commit

Permalink
feat(openponk): detect primary key constraint on the foreign key when…
Browse files Browse the repository at this point in the history
… inferring multiplicity
  • Loading branch information
jaburjak committed May 3, 2024
1 parent a8e3f35 commit 62758b9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MocoOpenPonkRdbForeignKeyTransformationRule >> determineSourceMultiplicity: aMoc
((engine input selectElementsOfKind: MocoOclRdbMandatoryMultiplicityConstraint) anySatisfy: [ :each | aMocoRdbForeignKey columns anySatisfy: [ :c | c == (each sourceColumn) ] ])
ifTrue: [ lower := 1 ].

(aMocoRdbTable constraints anySatisfy: [ :each | (each isKindOf: MocoRdbUniqueKey) and: [ each columns anySatisfy: [ :c | (aMocoRdbForeignKey columns anySatisfy: [ :e | e == c ]) ] ] ])
(aMocoRdbTable constraints anySatisfy: [ :each | ((each isKindOf: MocoRdbUniqueKey) or: [ each isKindOf: MocoRdbPrimaryKey ]) and: [ each columns anySatisfy: [ :c | (aMocoRdbForeignKey columns anySatisfy: [ :e | e == c ]) ] ] ])
ifTrue: [ upper := 1 ].

((engine input selectElementsOfKind: MocoOclRdbSpecialMultiplicityConstraint) select: [ :each | aMocoRdbForeignKey columns anySatisfy: [ :c | c == (each sourceColumn) ] ]) do: [ :each |
Expand Down

0 comments on commit 62758b9

Please sign in to comment.