Fix mariadb HasDefault column.

This commit is contained in:
go-jet 2025-03-02 14:45:41 +01:00
parent 48ff221747
commit 74f48fc567

View file

@ -18,8 +18,8 @@ func (m mySqlQuerySet) GetTablesMetaData(db *sql.DB, schemaName string, tableTyp
SELECT SELECT
t.table_name as "table.name", t.table_name as "table.name",
col.COLUMN_NAME AS "column.Name", col.COLUMN_NAME AS "column.Name",
col.COLUMN_DEFAULT IS NOT NULL AND t.table_type != 'VIEW' as "column.HasDefault", (col.COLUMN_DEFAULT IS NOT NULL AND col.COLUMN_DEFAULT != 'NULL') AND t.table_type != 'VIEW' as "column.HasDefault",
col.IS_NULLABLE = "YES" AS "column.IsNullable", col.IS_NULLABLE = 'YES' AS "column.IsNullable",
col.COLUMN_COMMENT AS "column.Comment", col.COLUMN_COMMENT AS "column.Comment",
COALESCE(pk.IsPrimaryKey, 0) AS "column.IsPrimaryKey", COALESCE(pk.IsPrimaryKey, 0) AS "column.IsPrimaryKey",
IF (col.COLUMN_TYPE = 'tinyint(1)', IF (col.COLUMN_TYPE = 'tinyint(1)',