File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1485,9 +1485,11 @@ def get_multi_foreign_keys(
14851485
14861486 if fkdelrule != "NO ACTION" :
14871487 fkey ["options" ]["ondelete" ] = fkdelrule
1488-
1489- fkey ["constrained_columns" ].append (scol )
1490- fkey ["referred_columns" ].append (rcol )
1488+
1489+ if scol not in fkey ["constrained_columns" ]:
1490+ fkey ["constrained_columns" ].append (scol )
1491+ if rcol not in fkey ["referred_columns" ]:
1492+ fkey ["referred_columns" ].append (rcol )
14911493
14921494 default = ReflectionDefaults .foreign_keys
14931495
@@ -1606,10 +1608,12 @@ def get_multi_columns(
16061608 ):
16071609 if charlen == - 1 :
16081610 charlen = None
1609- try :
1610- kwargs ["length" ] = int (charlen )
1611- except ValueError :
16121611 kwargs ["length" ] = 0
1612+ else :
1613+ try :
1614+ kwargs ["length" ] = int (charlen )
1615+ except ValueError :
1616+ kwargs ["length" ] = 0
16131617 if collation :
16141618 kwargs ["collation" ] = collation
16151619 if coltype is None :
You can’t perform that action at this time.
0 commit comments