Commit c95162e0 by Dan Cech Committed by Torkel Ödegaard

tweak column lengths for utf8mb4 support on older mysql (#8483)

parent 0d865a83
...@@ -16,7 +16,7 @@ func addAlertMigrations(mg *Migrator) { ...@@ -16,7 +16,7 @@ func addAlertMigrations(mg *Migrator) {
{Name: "org_id", Type: DB_BigInt, Nullable: false}, {Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false}, {Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "message", Type: DB_Text, Nullable: false}, {Name: "message", Type: DB_Text, Nullable: false},
{Name: "state", Type: DB_NVarchar, Length: 255, Nullable: false}, {Name: "state", Type: DB_NVarchar, Length: 190, Nullable: false},
{Name: "settings", Type: DB_Text, Nullable: false}, {Name: "settings", Type: DB_Text, Nullable: false},
{Name: "frequency", Type: DB_BigInt, Nullable: false}, {Name: "frequency", Type: DB_BigInt, Nullable: false},
{Name: "handler", Type: DB_BigInt, Nullable: false}, {Name: "handler", Type: DB_BigInt, Nullable: false},
...@@ -70,7 +70,7 @@ func addAlertMigrations(mg *Migrator) { ...@@ -70,7 +70,7 @@ func addAlertMigrations(mg *Migrator) {
mg.AddMigration("Update alert table charset", NewTableCharsetMigration("alert", []*Column{ mg.AddMigration("Update alert table charset", NewTableCharsetMigration("alert", []*Column{
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false}, {Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "message", Type: DB_Text, Nullable: false}, {Name: "message", Type: DB_Text, Nullable: false},
{Name: "state", Type: DB_NVarchar, Length: 255, Nullable: false}, {Name: "state", Type: DB_NVarchar, Length: 190, Nullable: false},
{Name: "settings", Type: DB_Text, Nullable: false}, {Name: "settings", Type: DB_Text, Nullable: false},
{Name: "severity", Type: DB_Text, Nullable: false}, {Name: "severity", Type: DB_Text, Nullable: false},
{Name: "execution_error", Type: DB_Text, Nullable: false}, {Name: "execution_error", Type: DB_Text, Nullable: false},
......
...@@ -56,7 +56,7 @@ func addDashboardMigration(mg *Migrator) { ...@@ -56,7 +56,7 @@ func addDashboardMigration(mg *Migrator) {
Columns: []*Column{ Columns: []*Column{
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, {Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "version", Type: DB_Int, Nullable: false}, {Name: "version", Type: DB_Int, Nullable: false},
{Name: "slug", Type: DB_NVarchar, Length: 190, Nullable: false}, {Name: "slug", Type: DB_NVarchar, Length: 189, Nullable: false},
{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false}, {Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "data", Type: DB_Text, Nullable: false}, {Name: "data", Type: DB_Text, Nullable: false},
{Name: "org_id", Type: DB_BigInt, Nullable: false}, {Name: "org_id", Type: DB_BigInt, Nullable: false},
...@@ -127,7 +127,7 @@ func addDashboardMigration(mg *Migrator) { ...@@ -127,7 +127,7 @@ func addDashboardMigration(mg *Migrator) {
})) }))
mg.AddMigration("Update dashboard table charset", NewTableCharsetMigration("dashboard", []*Column{ mg.AddMigration("Update dashboard table charset", NewTableCharsetMigration("dashboard", []*Column{
{Name: "slug", Type: DB_NVarchar, Length: 190, Nullable: false}, {Name: "slug", Type: DB_NVarchar, Length: 189, Nullable: false},
{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false}, {Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "plugin_id", Type: DB_NVarchar, Nullable: true, Length: 255}, {Name: "plugin_id", Type: DB_NVarchar, Nullable: true, Length: 255},
{Name: "data", Type: DB_MediumText, Nullable: false}, {Name: "data", Type: DB_MediumText, Nullable: false},
......
...@@ -9,10 +9,10 @@ func addTempUserMigrations(mg *Migrator) { ...@@ -9,10 +9,10 @@ func addTempUserMigrations(mg *Migrator) {
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, {Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "org_id", Type: DB_BigInt, Nullable: false}, {Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "version", Type: DB_Int, Nullable: false}, {Name: "version", Type: DB_Int, Nullable: false},
{Name: "email", Type: DB_NVarchar, Length: 255}, {Name: "email", Type: DB_NVarchar, Length: 190},
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: true}, {Name: "name", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "role", Type: DB_NVarchar, Length: 20, Nullable: true}, {Name: "role", Type: DB_NVarchar, Length: 20, Nullable: true},
{Name: "code", Type: DB_NVarchar, Length: 255}, {Name: "code", Type: DB_NVarchar, Length: 190},
{Name: "status", Type: DB_Varchar, Length: 20}, {Name: "status", Type: DB_Varchar, Length: 20},
{Name: "invited_by_user_id", Type: DB_BigInt, Nullable: true}, {Name: "invited_by_user_id", Type: DB_BigInt, Nullable: true},
{Name: "email_sent", Type: DB_Bool}, {Name: "email_sent", Type: DB_Bool},
...@@ -37,10 +37,10 @@ func addTempUserMigrations(mg *Migrator) { ...@@ -37,10 +37,10 @@ func addTempUserMigrations(mg *Migrator) {
addTableIndicesMigrations(mg, "v1-7", tempUserV1) addTableIndicesMigrations(mg, "v1-7", tempUserV1)
mg.AddMigration("Update temp_user table charset", NewTableCharsetMigration("temp_user", []*Column{ mg.AddMigration("Update temp_user table charset", NewTableCharsetMigration("temp_user", []*Column{
{Name: "email", Type: DB_NVarchar, Length: 255}, {Name: "email", Type: DB_NVarchar, Length: 190},
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: true}, {Name: "name", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "role", Type: DB_NVarchar, Length: 20, Nullable: true}, {Name: "role", Type: DB_NVarchar, Length: 20, Nullable: true},
{Name: "code", Type: DB_NVarchar, Length: 255}, {Name: "code", Type: DB_NVarchar, Length: 190},
{Name: "status", Type: DB_Varchar, Length: 20}, {Name: "status", Type: DB_Varchar, Length: 20},
{Name: "remote_addr", Type: DB_Varchar, Length: 255, Nullable: true}, {Name: "remote_addr", Type: DB_Varchar, Length: 255, Nullable: true},
})) }))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment