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(
1485
1485
1486
1486
if fkdelrule != "NO ACTION" :
1487
1487
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 )
1491
1493
1492
1494
default = ReflectionDefaults .foreign_keys
1493
1495
@@ -1606,10 +1608,12 @@ def get_multi_columns(
1606
1608
):
1607
1609
if charlen == - 1 :
1608
1610
charlen = None
1609
- try :
1610
- kwargs ["length" ] = int (charlen )
1611
- except ValueError :
1612
1611
kwargs ["length" ] = 0
1612
+ else :
1613
+ try :
1614
+ kwargs ["length" ] = int (charlen )
1615
+ except ValueError :
1616
+ kwargs ["length" ] = 0
1613
1617
if collation :
1614
1618
kwargs ["collation" ] = collation
1615
1619
if coltype is None :
You can’t perform that action at this time.
0 commit comments