utf8mb4 encoding (#7959)
* use utf8mb4 character set for connections to mysql * use utf8mb4 character set for tables, shorten varchar fields used in unique indexes * migration type to update table character set * update table character sets * set charset for temp_user.status * gofmt
This commit is contained in:
committed by
Torkel Ödegaard
parent
e91a078105
commit
24d4e50343
@@ -29,6 +29,7 @@ type Dialect interface {
|
||||
|
||||
TableCheckSql(tableName string) (string, []interface{})
|
||||
RenameTable(oldName string, newName string) string
|
||||
UpdateTableSql(tableName string, columns []*Column) string
|
||||
}
|
||||
|
||||
func NewDialect(name string) Dialect {
|
||||
@@ -102,7 +103,7 @@ func (b *BaseDialect) CreateTableSql(table *Table) string {
|
||||
|
||||
sql = sql[:len(sql)-2] + ")"
|
||||
if b.dialect.SupportEngine() {
|
||||
sql += " ENGINE=InnoDB DEFAULT CHARSET UTF8 "
|
||||
sql += " ENGINE=InnoDB DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"
|
||||
}
|
||||
|
||||
sql += ";"
|
||||
@@ -160,3 +161,7 @@ func (db *BaseDialect) DropIndexSql(tableName string, index *Index) string {
|
||||
name = index.XName(tableName)
|
||||
return fmt.Sprintf("DROP INDEX %v ON %s", quote(name), quote(tableName))
|
||||
}
|
||||
|
||||
func (db *BaseDialect) UpdateTableSql(tableName string, columns []*Column) string {
|
||||
return "-- NOT REQUIRED"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user