软件中识别出数据库的字段配置:
数据库DDL的配置:
修改MySQL的字段查询元数据模板如下图所示:

使用下方的模板替换即可:
SELECT
table_schema as schema_name,
table_name AS tbl_def_key,
ordinal_position as order_value,
column_name AS def_key,
column_comment AS def_name,
'' AS intro,
column_type,
data_type AS db_data_type,
IF(data_type = column_type or data_type = 'decimal' or data_type = 'datetime', IF(data_type = 'decimal' or data_type = 'datetime', CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(COLUMN_TYPE, '(', -1), ',', 1) AS UNSIGNED), NULL),character_maximum_length) AS data_len,
IF(data_type = column_type or data_type = 'decimal', IF(data_type = 'decimal', CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(COLUMN_TYPE, ',', -1), ')', 1) AS UNSIGNED), NULL), numeric_scale ) AS num_scale,
IF(column_key = 'PRI', 1, 0 ) AS primary_key,
IF(is_nullable = 'YES', 0, 1 ) AS not_null,
IF(extra = 'AUTO_INCREMENT', 1, 0 ) AS auto_increment,
column_default AS default_value
FROM
information_schema.COLUMNS
WHERE
table_schema in (:schemaName)
and CONCAT(table_schema, '.', table_name) in (:sysTableNames)
ORDER BY
table_schema ASC,
table_name ASC,
ordinal_position ASC
什么数据库