diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-12-06 19:05:53 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-12-06 19:05:53 -0500 |
commit | db44516cd9d6c12c2107a973d993ccec2810f17f (patch) | |
tree | b56de9b4bb015fbb06ec4bb8bd7cb75e0e1e2cf6 /tests/test_mssql.py | |
parent | da054c2981c641b615e0f01f2220cde9ffad39ce (diff) | |
download | alembic-db44516cd9d6c12c2107a973d993ccec2810f17f.tar.gz |
- Added new argument ``mssql_drop_foreign_key`` to
:meth:`.Operations.drop_column`. Like ``mssql_drop_default``
and ``mssql_drop_check``, will do an inline lookup for a
single foreign key which applies to this column, and drop it.
For a column with more than one FK, you'd still need to explicitly
use :meth:`.Operations.drop_constraint` given the name,
even though only MSSQL has this limitation in the first place.
Diffstat (limited to 'tests/test_mssql.py')
-rw-r--r-- | tests/test_mssql.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_mssql.py b/tests/test_mssql.py index c0182b2..382c99c 100644 --- a/tests/test_mssql.py +++ b/tests/test_mssql.py @@ -110,6 +110,12 @@ class OpTest(TestCase): "ALTER TABLE t ALTER COLUMN c INTEGER NULL" ) + def test_drop_column_w_fk(self): + context = op_fixture('mssql') + op.drop_column('t1', 'c1', mssql_drop_foreign_key=True) + context.assert_contains("exec('alter table t1 drop constraint ' + @const_name)") + context.assert_contains("ALTER TABLE t1 DROP COLUMN c1") + def test_alter_column_not_nullable_w_existing_type(self): context = op_fixture('mssql') op.alter_column("t", "c", nullable=False, existing_type=Integer) |