fix lost migrations (#3661)

This commit is contained in:
Alex Sharov 2022-03-09 16:46:48 +07:00 committed by GitHub
parent 0b2ce6f845
commit a5f4c721bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,6 +156,16 @@ func (m *Migrator) Apply(db kv.RwDB, datadir string) error {
}
var applied map[string][]byte
if err := db.View(context.Background(), func(tx kv.Tx) error {
var err error
applied, err = AppliedMigrations(tx, false)
if err != nil {
return fmt.Errorf("reading applied migrations: %w", err)
}
return nil
}); err != nil {
return err
}
if err := m.VerifyVersion(db); err != nil {
return err
}