File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,12 +103,21 @@ func (cmd *ConfigUpgradeCommand) Execute([]string) (err error) {
103103 if ! opts .IsPgConnStr (uri ) {
104104 return fmt .Errorf ("cannot upgrade storage %s: %w" , uri , errors .ErrUnsupported )
105105 }
106- m , initErr := newMigratorFunc ()
106+ obj , initErr := newMigratorFunc ()
107107 if initErr != nil {
108108 return initErr
109109 }
110- return m .(db.Migrator ).Migrate ()
110+ if m , ok := obj .(db.Migrator ); ok {
111+ return m .Migrate ()
112+ }
113+ return nil
114+ }
111115
116+ switch {
117+ case opts .Sources .Sources == "" && opts .IsPgConnStr (opts .Metrics .Metrics ):
118+ opts .Sources .Sources = opts .Metrics .Metrics
119+ case opts .Metrics .Metrics == "" && opts .IsPgConnStr (opts .Sources .Sources ):
120+ opts .Metrics .Metrics = opts .Sources .Sources
112121 }
113122
114123 err = f (opts .Sources .Sources , func () (any , error ) {
You can’t perform that action at this time.
0 commit comments