From 623569886392e1d9b7fd77f8bad9ca4cc1fb9563 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 11 Mar 2015 11:34:40 -0400 Subject: - Fixed bug where the mssql DROP COLUMN directive failed to include modifiers such as "schema" when emitting the DDL. fixes #284 --- alembic/ddl/mssql.py | 2 +- docs/build/changelog.rst | 7 +++++++ tests/test_mssql.py | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/alembic/ddl/mssql.py b/alembic/ddl/mssql.py index 26c8a25..f516e9b 100644 --- a/alembic/ddl/mssql.py +++ b/alembic/ddl/mssql.py @@ -123,7 +123,7 @@ class MSSQLImpl(DefaultImpl): self._exec( _ExecDropFKConstraint(table_name, column) ) - super(MSSQLImpl, self).drop_column(table_name, column) + super(MSSQLImpl, self).drop_column(table_name, column, **kw) class _ExecDropConstraint(Executable, ClauseElement): diff --git a/docs/build/changelog.rst b/docs/build/changelog.rst index 73a046f..d7e239e 100644 --- a/docs/build/changelog.rst +++ b/docs/build/changelog.rst @@ -6,6 +6,13 @@ Changelog .. changelog:: :version: 0.7.5 + .. change:: + :tags: bug, operations, mssql + :tickets: 284 + + Fixed bug where the mssql DROP COLUMN directive failed to include + modifiers such as "schema" when emitting the DDL. + .. change:: :tags: bug, autogenerate, postgresql :tickets: 282 diff --git a/tests/test_mssql.py b/tests/test_mssql.py index 04fc4d4..19453b2 100644 --- a/tests/test_mssql.py +++ b/tests/test_mssql.py @@ -116,6 +116,11 @@ class OpTest(TestBase): op.alter_column("t", "c", server_default=False) context.assert_() + def test_drop_column_w_schema(self): + context = op_fixture('mssql') + op.drop_column('t1', 'c1', schema='xyz') + context.assert_contains("ALTER TABLE xyz.t1 DROP COLUMN c1") + def test_drop_column_w_check(self): context = op_fixture('mssql') op.drop_column('t1', 'c1', mssql_drop_check=True) -- cgit v1.2.1