autoincrement=autoincrement
if autoincrement is not None
else existing_autoincrement,
+ comment=comment
+ if comment is not False
+ else existing_comment,
)
)
elif (
--- /dev/null
+.. change::
+ :tags: bug, mysql
+ :tickets: 594
+
+ Fixed issue where emitting a change of column name for MySQL did not
+ preserve the column comment, even if it were specified as existing_comment.
+
"COMMENT 'existing column comment'"
)
+ @config.requirements.comments_api
+ def test_rename_column_existing_comment(self):
+ context = op_fixture("mysql")
+ op.alter_column(
+ "t1",
+ "c1",
+ new_column_name="newc1",
+ existing_nullable=False,
+ existing_comment="existing column comment",
+ existing_type=Integer,
+ )
+
+ context.assert_(
+ "ALTER TABLE t1 CHANGE c1 newc1 INTEGER NOT NULL "
+ "COMMENT 'existing column comment'"
+ )
+
@config.requirements.comments_api
def test_alter_column_new_comment_replaces_existing(self):
context = op_fixture("mysql")