ResourceServer: Resource store sql backend (#90170)

This commit is contained in:
Georges Chaudy
2024-07-18 08:03:18 -07:00
committed by GitHub
parent bb40fb342a
commit 08c611c68b
71 changed files with 2871 additions and 35 deletions
@@ -0,0 +1,24 @@
package migrations
import (
"xorm.io/xorm"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/setting"
)
func MigrateResourceStore(engine *xorm.Engine, cfg *setting.Cfg, features featuremgmt.FeatureToggles) error {
// Skip if feature flag is not enabled
if !features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorage) {
return nil
}
mg := migrator.NewScopedMigrator(engine, cfg, "resource")
mg.AddCreateMigration()
initResourceTables(mg)
// since it's a new feature enable migration locking by default
return mg.Start(true, 0)
}