From f224fd8310076092a6926cdc2afa7d3c46317f61 Mon Sep 17 00:00:00 2001 From: Dan Cech Date: Sun, 4 Jun 2017 08:28:03 -0400 Subject: [PATCH] reduce length of dashboard columns used in compound indexes (#8507) --- pkg/services/sqlstore/migrations/dashboard_mig.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/services/sqlstore/migrations/dashboard_mig.go b/pkg/services/sqlstore/migrations/dashboard_mig.go index 0519194ae31..ee0cc1d893f 100644 --- a/pkg/services/sqlstore/migrations/dashboard_mig.go +++ b/pkg/services/sqlstore/migrations/dashboard_mig.go @@ -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}, }))