diff --git a/docs/changelog.rst b/docs/changelog.rst index 218fd1d..ef2f7d5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -8,7 +8,8 @@ Fixed Bugs ****************** - docs/_build is excluded from source tarball builds - +- use table.append_column() instead of column._set_parent() in + ChangesetColumn.add_to_table() 0.7 (2011-05-27) --------------------------- 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