From 35eccc748ab271e91bb18628fe5dc214448b380f Mon Sep 17 00:00:00 2001 From: thinkgos Date: Mon, 13 May 2024 19:42:54 +0800 Subject: [PATCH] fix: fix gen sql bug --- driver/mysql/def_atlas.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/driver/mysql/def_atlas.go b/driver/mysql/def_atlas.go index 643a808..49995bb 100644 --- a/driver/mysql/def_atlas.go +++ b/driver/mysql/def_atlas.go @@ -27,13 +27,7 @@ func intoColumnSql(col *schema.Column) string { } else { switch x := schema.UnderlyingExpr(col.Default).(type) { case *schema.Literal: - dv := x.V - if dv == `""` || dv == "" { - dv = "''" - } else { - dv = strings.Trim(dv, `"`) // format: `"xxx"` or `'xxx'` - } - fmt.Fprintf(b, " DEFAULT '%s'", strings.Trim(dv, `"`)) + fmt.Fprintf(b, " DEFAULT '%s'", strings.Trim(x.V, `"`)) case *schema.RawExpr: fmt.Fprintf(b, " DEFAULT %s", x.X) case nil: