summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-11-23 12:36:34 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-11-23 12:36:34 -0500
commitaf8f70af6a6baa3b66875be157684f4921743a30 (patch)
tree69087d5fa22d05e12f8e0dd8e079bcf9e1c669da
parent7a5641db0bb3d2391fd44f6c631601bf44e4bb26 (diff)
downloadalembic-af8f70af6a6baa3b66875be157684f4921743a30.tar.gz
fix
-rw-r--r--alembic/ddl/base.py4
-rw-r--r--tests/test_op.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/alembic/ddl/base.py b/alembic/ddl/base.py
index 697d99e..da47306 100644
--- a/alembic/ddl/base.py
+++ b/alembic/ddl/base.py
@@ -72,9 +72,9 @@ def visit_column_nullable(element, compiler, **kw):
@compiles(ColumnName)
def visit_column_name(element, compiler, **kw):
- return "%s %s RENAME TO %s" % (
+ return "%s RENAME %s TO %s" % (
alter_table(compiler, element.table_name, element.schema),
- alter_column(compiler, element.column_name),
+ format_column_name(compiler, element.column_name),
format_column_name(compiler, element.newname)
)
diff --git a/tests/test_op.py b/tests/test_op.py
index f8554f2..d917384 100644
--- a/tests/test_op.py
+++ b/tests/test_op.py
@@ -58,7 +58,7 @@ def test_alter_column_rename():
context = _op_fixture()
op.alter_column("t", "c", name="x")
context.assert_(
- "ALTER TABLE t ALTER COLUMN c RENAME TO x"
+ "ALTER TABLE t RENAME c TO x"
)
def test_add_foreign_key():