hanchuanchuan / goInception

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

JSON字符串属性不支持 #582

Closed yuexiaofengqing closed 1 year ago

yuexiaofengqing commented 1 year ago

描述 当我使用JSON的字段属性时,检查报错TEXT/BLOB Column 'messageBody' in table 'retry_message' can't been not null. 重现 建表语句如下: CREATE TABLE retry_message ( id bigint(20) unsigned NOT NULL, messageBody json NOT NULL , messageType varchar(30) NOT NULL , messageStatus varchar(30) NOT NULL PRIMARY KEY (id) USING BTREE, KEY idx_messageStatus (messageStatus) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT;

环境

dbawsp commented 1 year ago

兄弟,你messageStatus 字段少一个逗号

hanchuanchuan commented 1 year ago

请查阅文档参数enable_blob_not_null. 另可设置 er_text_not_nullable_error ERROR LEVEL忽略, inc set level er_text_not_nullable_error=0; (支持会话级别设置)