From 2b0261f0550e4f3d476abdfbc967cbd593cc9694 Mon Sep 17 00:00:00 2001 From: simontigers <47096077+simontigers@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:48:16 +0800 Subject: [PATCH] fix(api): common check new columns --- cmdb-api/api/commands/click_common_setting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdb-api/api/commands/click_common_setting.py b/cmdb-api/api/commands/click_common_setting.py index 37e8ffe..8c2f52d 100644 --- a/cmdb-api/api/commands/click_common_setting.py +++ b/cmdb-api/api/commands/click_common_setting.py @@ -224,7 +224,7 @@ def common_check_new_columns(): column_type = new_column.type.compile(engine.dialect) 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: sql += f" comment '{new_column.comment}'"