fixed issue #5517: H2 database field type error causing 'Value too long for column' exception

- Changed meta_snapshot.data from longtext to CLOB in H2 schema
- Changed meta_history.sql_text from longtext to CLOB in H2 schema
- H2 database doesn't recognize MySQL's longtext type and converts it to VARCHAR with length limit
- CLOB type supports up to 2GB text data, solving the issue when storing large table structures (>1MB DDL)
This commit is contained in:
jianghang.loujh
2026-02-12 17:42:44 +08:00
parent 1a265c8960
commit 69a06dba09
2 changed files with 2 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS `meta_history` (
`use_schema` varchar(1024) DEFAULT NULL COMMENT '执行sql时对应的schema',
`sql_schema` varchar(1024) DEFAULT NULL COMMENT '对应的schema',
`sql_table` varchar(1024) DEFAULT NULL COMMENT '对应的table',
`sql_text` longtext DEFAULT NULL COMMENT '执行的sql',
`sql_text` CLOB DEFAULT NULL COMMENT '执行的sql',
`sql_type` varchar(256) DEFAULT NULL COMMENT 'sql类型',
`extra` text DEFAULT NULL COMMENT '额外的扩展信息',
PRIMARY KEY (`id`),