summaryrefslogtreecommitdiff
path: root/migrate
diff options
context:
space:
mode:
authorJan Dittberner <jan.dittberner@googlemail.com>2011-05-27 21:59:35 +0200
committerJan Dittberner <jan.dittberner@googlemail.com>2011-05-27 21:59:35 +0200
commitca5d59910a9f968f25736757a5e5710c13df8fda (patch)
treea4538142c3ec7c2f042687497c88766581fcccfe /migrate
parent2e28635b0b412fd921ec5245ad30987dfefe98e3 (diff)
downloadsqalchemy-migrate-ca5d59910a9f968f25736757a5e5710c13df8fda.tar.gz
fix column.create() properly
Diffstat (limited to 'migrate')
-rw-r--r--migrate/changeset/schema.py5
-rw-r--r--migrate/tests/changeset/test_changeset.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/migrate/changeset/schema.py b/migrate/changeset/schema.py
index 1bd3fc0..f4377ba 100644
--- a/migrate/changeset/schema.py
+++ b/migrate/changeset/schema.py
@@ -555,7 +555,10 @@ populated with defaults
def add_to_table(self, table):
if table is not None and self.table is None:
- self._set_parent(table)
+ if SQLA_07:
+ table.append_column(self)
+ else:
+ self._set_parent(table)
def _col_name_in_constraint(self,cons,name):
return False
diff --git a/migrate/tests/changeset/test_changeset.py b/migrate/tests/changeset/test_changeset.py
index 89225a4..ffadcdb 100644
--- a/migrate/tests/changeset/test_changeset.py
+++ b/migrate/tests/changeset/test_changeset.py
@@ -169,8 +169,6 @@ class TestAddDropColumn(fixture.DB):
# create column with fk
col = Column('data', Integer, ForeignKey(reftable.c.id))
- if SQLA_07:
- self.table.append_column(col)
col.create(self.table)
# check if constraint is added