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:
Dan Cech
2017-03-28 08:34:53 -04:00
committed by Torkel Ödegaard
parent e91a078105
commit 24d4e50343
19 changed files with 198 additions and 22 deletions
@@ -9,7 +9,7 @@ func addAppSettingsMigration(mg *Migrator) {
Columns: []*Column{
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "org_id", Type: DB_BigInt, Nullable: true},
{Name: "plugin_id", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "plugin_id", Type: DB_NVarchar, Length: 190, Nullable: false},
{Name: "enabled", Type: DB_Bool, Nullable: false},
{Name: "pinned", Type: DB_Bool, Nullable: false},
{Name: "json_data", Type: DB_Text, Nullable: true},
@@ -32,4 +32,10 @@ func addAppSettingsMigration(mg *Migrator) {
Name: "plugin_version", Type: DB_NVarchar, Nullable: true, Length: 50,
}))
mg.AddMigration("Update plugin_setting table charset", NewTableCharsetMigration("plugin_setting", []*Column{
{Name: "plugin_id", Type: DB_NVarchar, Length: 190, Nullable: false},
{Name: "json_data", Type: DB_Text, Nullable: true},
{Name: "secure_json_data", Type: DB_Text, Nullable: true},
{Name: "plugin_version", Type: DB_NVarchar, Nullable: true, Length: 50},
}))
}