From 56a323b4636b9fb59efb459508e1460978789ff4 Mon Sep 17 00:00:00 2001 From: Gowa2017 <33367355+Gowa2017@users.noreply.github.com> Date: Mon, 7 Jul 2025 18:08:57 +0800 Subject: [PATCH] fix: Use MySQL information.schema columns table with ORDINAL_POSITION as order to get same order of the create table sql --- modules/db/dialect/mysql.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/db/dialect/mysql.go b/modules/db/dialect/mysql.go index 2270f7f6a..fa1f5e3a0 100644 --- a/modules/db/dialect/mysql.go +++ b/modules/db/dialect/mysql.go @@ -19,7 +19,8 @@ func (mysql) ShowColumnsWithComment(schema, table string) string { WHERE table_name = '` + table + `' AND - table_schema = '` + schema + `'` + table_schema = '` + schema + `'` + + `ORDER BY ORDINAL_POSITION` } func (mysql) ShowColumns(table string) string {