diff --git a/lib/db/schema/ddl/ddl.go b/lib/db/schema/ddl/ddl.go index 149037f7..f8dda5cc 100644 --- a/lib/db/schema/ddl/ddl.go +++ b/lib/db/schema/ddl/ddl.go @@ -118,6 +118,12 @@ func FromStatement(stmt *gorm.Statement) Table { Unique: field.Unique, } + if len(column.Default) > 0 { + if !(column.Default[0] == '\'' || column.Default[0] == '"' || column.Default[0] == '`') { + column.Default = strconv.Quote(column.Default) + } + } + if v, ok := field.TagSettings["CHARSET"]; ok { column.Charset = v }