Commit 025a14ec by Marcus Efraimsson

db: add migrations for creating a unique index for uid. #7883

parent 50aa9ec6
......@@ -160,4 +160,8 @@ func addDashboardMigration(mg *Migrator) {
Sqlite("UPDATE dashboard SET uid=printf('%09d',id) WHERE uid IS NULL;").
Postgres("UPDATE dashboard SET uid=lpad('' || id,9,'0') WHERE uid IS NULL;").
Mysql("UPDATE dashboard SET uid=lpad(id,9,'0') WHERE uid IS NULL;"))
mg.AddMigration("Add index for uid in dashboard", NewAddIndexMigration(dashboardV2, &Index{
Cols: []string{"uid"}, Type: UniqueIndex,
}))
}
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