From 81f447ef7726732de4e2cfed15a59ee6dc738242 Mon Sep 17 00:00:00 2001 From: iElectric Date: Sun, 2 May 2010 03:03:03 +0200 Subject: [PATCH] SA06 tests fix, thanks to Mike Bayer --- TODO | 2 +- migrate/changeset/ansisql.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index d1f0fa4..a97c647 100644 --- a/TODO +++ b/TODO @@ -13,9 +13,9 @@ make_update_script_for_model: - make logging stderr and stdout aware - update documentation - update repository migration script +- readd transaction support - wrap migration into transaction - interactive migration script resolution -- readd transaction support - port to unittest2 - write documentation how to test all databases diff --git a/migrate/changeset/ansisql.py b/migrate/changeset/ansisql.py index ee585a7..69c90e9 100644 --- a/migrate/changeset/ansisql.py +++ b/migrate/changeset/ansisql.py @@ -7,6 +7,7 @@ import sqlalchemy as sa from sqlalchemy.schema import SchemaVisitor from sqlalchemy.engine.default import DefaultDialect +from sqlalchemy.sql import ClauseElement from sqlalchemy.schema import (ForeignKeyConstraint, PrimaryKeyConstraint, CheckConstraint, @@ -23,9 +24,15 @@ else: from sqlalchemy.sql.compiler import DDLCompiler SchemaGenerator = SchemaDropper = DDLCompiler + class AlterTableVisitor(SchemaVisitor): """Common operations for ``ALTER TABLE`` statements.""" + if SQLA_06: + # engine.Compiler looks for .statement + # when it spawns off a new compiler + statement = ClauseElement() + def append(self, s): """Append content to the SchemaIterator's query buffer."""