fix generation of foreign key constraint name in
migrate.changeset.constraint.ForeignKeyConstraint.autoname use <table>_<firstcol>_fkey instead of <table>_<reftable>_fkey Fixes Issue 101
This commit is contained in:
parent
eb6e2eea24
commit
73796f3e54
@ -126,9 +126,9 @@ class ForeignKeyConstraint(ConstraintChangeset, schema.ForeignKeyConstraint):
|
||||
|
||||
def autoname(self):
|
||||
"""Mimic the database's automatic constraint names"""
|
||||
ret = "%(table)s_%(reftable)s_fkey" % dict(
|
||||
ret = "%(table)s_%(firstcolumn)s_fkey" % dict(
|
||||
table=self.table.name,
|
||||
reftable=self.reftable.name,)
|
||||
firstcolumn=self.columns[0],)
|
||||
return ret
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user