From 74f48fc567b37cc1e8118a33ec120e8a255e3c29 Mon Sep 17 00:00:00 2001 From: go-jet Date: Sun, 2 Mar 2025 14:45:41 +0100 Subject: [PATCH] Fix mariadb HasDefault column. --- generator/mysql/query_set.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generator/mysql/query_set.go b/generator/mysql/query_set.go index 14da5aa..5063f7c 100644 --- a/generator/mysql/query_set.go +++ b/generator/mysql/query_set.go @@ -18,8 +18,8 @@ func (m mySqlQuerySet) GetTablesMetaData(db *sql.DB, schemaName string, tableTyp SELECT t.table_name as "table.name", col.COLUMN_NAME AS "column.Name", - col.COLUMN_DEFAULT IS NOT NULL AND t.table_type != 'VIEW' as "column.HasDefault", - col.IS_NULLABLE = "YES" AS "column.IsNullable", + (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.COLUMN_COMMENT AS "column.Comment", COALESCE(pk.IsPrimaryKey, 0) AS "column.IsPrimaryKey", IF (col.COLUMN_TYPE = 'tinyint(1)',