Skip to content

Commit

Permalink
fix db default charset error
Browse files Browse the repository at this point in the history
* fix db default charset error

* add table charset empty check
  • Loading branch information
xormplus committed Aug 26, 2018
1 parent 96822e6 commit 21dcd99
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dialect_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,12 @@ func (db *mysql) CreateTableSql(table *core.Table, tableName, storeEngine, chars

if len(charset) == 0 {
charset = db.URI().Charset
} else if len(charset) > 0 {
}
if len(charset) != 0 {
sql += " DEFAULT CHARSET " + charset
}



if db.rowFormat != "" {
sql += " ROW_FORMAT=" + db.rowFormat
Expand Down

0 comments on commit 21dcd99

Please sign in to comment.