hanchuanchuan / goInception

一个集审核、执行、备份及生成回滚语句于一身的MySQL运维工具
https://hanchuanchuan.github.io/goInception/
GNU General Public License v3.0
1.6k stars 545 forks source link

怎么让goinception不检查after列的存在性 #578

Closed czxin788 closed 1 year ago

czxin788 commented 1 year ago

描述 怎么让goinception不检查after列的存在性

重现 ALTER TABLE t1 ADD COLUMN convert_num decimal(8, 2) UNSIGNED DEFAULT NULL COMMENT 'test'; 审核成功

ALTER TABLE t1 ADD COLUMN convert_num_unit varchar(38) DEFAULT '' COMMENT 'test' AFTER convert_num; 审核报: t1.convert_num 不存在

其实是因为第一个sql的convert_num列还没加上呢,所以第二个sql报错了。怎么让goinception不检查after列的存在性

环境

参数

stale[bot] commented 1 year ago

由于此问题没有最近的活动,因此已被自动标记为陈旧。如果没有进一步的活动,会作为不活跃issue关闭。感谢你对本项目的贡献。 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

hanchuanchuan commented 1 year ago

建议合并到同一个alter table语句中, 如果是大表的话, 拆分为多条DDL对数据库的影响会比较大. 另外如果是已存在的列, After校验逻辑是没问题的.