global_map.go 623 B

1234567891011121314151617181920
  1. package startup_migrations
  2. import (
  3. "github.com/porter-dev/porter/cmd/migrate/enable_cluster_preview_envs"
  4. "github.com/porter-dev/porter/cmd/migrate/migrate_legacy_rbac"
  5. lr "github.com/porter-dev/porter/pkg/logger"
  6. "gorm.io/gorm"
  7. )
  8. // this should be incremented with every new startup migration script
  9. const LatestMigrationVersion uint = 1
  10. type migrationFunc func(db *gorm.DB, logger *lr.Logger) error
  11. var StartupMigrations = make(map[uint]migrationFunc)
  12. func init() {
  13. StartupMigrations[1] = migrate_legacy_rbac.MigrateFromLegacyRBAC
  14. StartupMigrations[1] = enable_cluster_preview_envs.EnableClusterPreviewEnvs
  15. }