reduce length of dashboard columns used in compound indexes (#8507)

This commit is contained in:
Dan Cech 2017-06-04 08:28:03 -04:00 committed by Torkel Ödegaard
parent 4fe9935321
commit f224fd8310

View File

@ -8,7 +8,7 @@ func addDashboardMigration(mg *Migrator) {
Columns: []*Column{
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{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: "data", Type: DB_Text, Nullable: false},
{Name: "account_id", Type: DB_BigInt, Nullable: false},
@ -114,7 +114,7 @@ func addDashboardMigration(mg *Migrator) {
// add column to store plugin_id
mg.AddMigration("Add column plugin_id in dashboard", NewAddColumnMigration(dashboardV2, &Column{
Name: "plugin_id", Type: DB_NVarchar, Nullable: true, Length: 255,
Name: "plugin_id", Type: DB_NVarchar, Nullable: true, Length: 189,
}))
mg.AddMigration("Add index for plugin_id in dashboard", NewAddIndexMigration(dashboardV2, &Index{
@ -129,7 +129,7 @@ func addDashboardMigration(mg *Migrator) {
mg.AddMigration("Update dashboard table charset", NewTableCharsetMigration("dashboard", []*Column{
{Name: "slug", Type: DB_NVarchar, Length: 189, 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: 189},
{Name: "data", Type: DB_MediumText, Nullable: false},
}))