Chore: Add folder data migration, fix unique index (#72602)

* add folder data migration, fix unique index

* fix unique index

* pass a fake store in tests

* pass store into other providers in tests

* and now with alerting!
This commit is contained in:
Serge Zaitsev
2023-08-01 09:36:37 +02:00
committed by GitHub
parent 6d98d06f6e
commit 7767ab6f43
8 changed files with 21 additions and 12 deletions

View File

@@ -26,6 +26,15 @@ func addFolderMigrations(mg *migrator.Migrator) {
Type: migrator.UniqueIndex,
Cols: []string{"title", "parent_uid"},
}))
mg.AddMigration("Remove unique index for folder.title and folder.parent_uid", migrator.NewDropIndexMigration(folderv1(), &migrator.Index{
Type: migrator.UniqueIndex,
Cols: []string{"title", "parent_uid"},
}))
mg.AddMigration("Add unique index for title, parent_uid, and org_id", migrator.NewAddIndexMigration(folderv1(), &migrator.Index{
Type: migrator.UniqueIndex,
Cols: []string{"title", "parent_uid", "org_id"},
}))
}
func folderv1() migrator.Table {