fix: only migrate when version is lower

resolves #1998
This commit is contained in:
Jan De Dobbeleer 2022-03-28 06:38:57 +02:00 committed by Jan De Dobbeleer
parent 54e3a07953
commit 60fd1d08eb

View file

@ -83,7 +83,7 @@ func (cfg *Config) exitWithError(err error) {
func LoadConfig(env environment.Environment) *Config {
cfg := loadConfig(env)
// only migrate automatically when the switch isn't set
if !env.Flags().Migrate && cfg.Version != configVersion {
if !env.Flags().Migrate && cfg.Version < configVersion {
cfg.BackupAndMigrate(env)
}
return cfg