diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-04 15:43:33 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-04 15:43:33 -0400 |
commit | 0fc1e5fdf34ca3e9b6f48766cf72ec07e69666dd (patch) | |
tree | aeb256f54125ca481ac45871f37aad741229d408 /tests/test_mssql.py | |
parent | 3d1ed96698e0dee8f6fa82bd68616a5d324a0d9e (diff) | |
download | alembic-0fc1e5fdf34ca3e9b6f48766cf72ec07e69666dd.tar.gz |
Fixed bug whereby double quoting would be applied
to target column name during an ``sp_rename``
operation.
#109
Diffstat (limited to 'tests/test_mssql.py')
-rw-r--r-- | tests/test_mssql.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_mssql.py b/tests/test_mssql.py index 0948581..66cdb9a 100644 --- a/tests/test_mssql.py +++ b/tests/test_mssql.py @@ -53,7 +53,14 @@ class OpTest(TestCase): context = op_fixture('mssql') op.alter_column("t", "c", new_column_name="x") context.assert_( - "EXEC sp_rename 't.c', 'x', 'COLUMN'" + "EXEC sp_rename 't.c', x, 'COLUMN'" + ) + + def test_alter_column_rename_quoted_mssql(self): + context = op_fixture('mssql') + op.alter_column("t", "c", new_column_name="SomeFancyName") + context.assert_( + "EXEC sp_rename 't.c', [SomeFancyName], 'COLUMN'" ) def test_alter_column_new_type(self): @@ -157,7 +164,7 @@ class OpTest(TestCase): context.assert_( 'ALTER TABLE t ALTER COLUMN c INTEGER NULL', "ALTER TABLE t ADD DEFAULT '5' FOR c", - "EXEC sp_rename 't.c', 'c2', 'COLUMN'" + "EXEC sp_rename 't.c', c2, 'COLUMN'" ) # TODO: when we add schema support |