From 73796f3e543a121b51a0fe2eb08d1faab255e53b Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 7 Nov 2010 22:19:36 +0100 Subject: fix generation of foreign key constraint name in migrate.changeset.constraint.ForeignKeyConstraint.autoname use __fkey instead of
__fkey Fixes Issue 101 --- migrate/changeset/constraint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'migrate/changeset/constraint.py') 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 -- cgit v1.2.1