mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
db: add migrations for creating a unique index for uid. #7883
This commit is contained in:
@@ -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,
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user