Commit f224fd83 by Dan Cech Committed by Torkel Ödegaard

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

parent 4fe99353
...@@ -8,7 +8,7 @@ func addDashboardMigration(mg *Migrator) { ...@@ -8,7 +8,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: "account_id", Type: DB_BigInt, Nullable: false}, {Name: "account_id", Type: DB_BigInt, Nullable: false},
...@@ -114,7 +114,7 @@ func addDashboardMigration(mg *Migrator) { ...@@ -114,7 +114,7 @@ func addDashboardMigration(mg *Migrator) {
// add column to store plugin_id // add column to store plugin_id
mg.AddMigration("Add column plugin_id in dashboard", NewAddColumnMigration(dashboardV2, &Column{ 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{ mg.AddMigration("Add index for plugin_id in dashboard", NewAddIndexMigration(dashboardV2, &Index{
...@@ -129,7 +129,7 @@ func addDashboardMigration(mg *Migrator) { ...@@ -129,7 +129,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: 189, 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: 189},
{Name: "data", Type: DB_MediumText, Nullable: false}, {Name: "data", Type: DB_MediumText, Nullable: false},
})) }))
......
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