diff options
author | Jan Dittberner <jan@dittberner.info> | 2010-11-07 22:19:36 +0100 |
---|---|---|
committer | Jan Dittberner <jan@dittberner.info> | 2010-11-07 22:19:36 +0100 |
commit | 73796f3e543a121b51a0fe2eb08d1faab255e53b (patch) | |
tree | e5d7851b23c069b770d6e84e5dbbd78dedb245a7 /migrate/changeset/constraint.py | |
parent | eb6e2eea24fc704e355589e78826b9c2cb15b097 (diff) | |
download | sqlalchemy-migrate-73796f3e543a121b51a0fe2eb08d1faab255e53b.tar.gz |
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
Diffstat (limited to 'migrate/changeset/constraint.py')
-rw-r--r-- | migrate/changeset/constraint.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/migrate/changeset/constraint.py b/migrate/changeset/constraint.py index 2e2ec7f..34b2d1a 100644 --- a/migrate/changeset/constraint.py +++ b/migrate/changeset/constraint.py @@ -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 |