Skip to content

Commit

Permalink
null db migration
Browse files Browse the repository at this point in the history
  • Loading branch information
iesreza committed Dec 18, 2023
1 parent 6bee5a4 commit 9e9fb4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/db/schema/ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9e9fb4f

Please sign in to comment.