fix(api): common check new columns

This commit is contained in:
simontigers 2024-03-22 16:48:16 +08:00 committed by GitHub
parent 4117cf87ec
commit 7d46e92c2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -224,7 +224,7 @@ def common_check_new_columns():
column_type = new_column.type.compile(engine.dialect) column_type = new_column.type.compile(engine.dialect)
default_value = new_column.default.arg if new_column.default else None default_value = new_column.default.arg if new_column.default else None
sql = "ALTER TABLE " + target_table_name + " ADD COLUMN " + new_column.name + " " + column_type sql = "ALTER TABLE " + target_table_name + " ADD COLUMN " + f"`{new_column.name}`" + " " + column_type
if new_column.comment: if new_column.comment:
sql += f" comment '{new_column.comment}'" sql += f" comment '{new_column.comment}'"