mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
fix(db/migration): avoid fatal error from being overwritten (#10316)
This commit is contained in:
parent
e3a4b7ad17
commit
cc37ccfe4d
2 changed files with 6 additions and 6 deletions
|
@ -51,9 +51,9 @@ func (store *Store) MigrateData() error {
|
|||
err = errors.Wrap(err, "failed to migrate database")
|
||||
|
||||
log.Warn().Err(err).Msg("migration failed, restoring database to previous version")
|
||||
err = store.restoreWithOptions(&BackupOptions{BackupPath: backupPath})
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to restore database")
|
||||
restorErr := store.restoreWithOptions(&BackupOptions{BackupPath: backupPath})
|
||||
if restorErr != nil {
|
||||
return errors.Wrap(restorErr, "failed to restore database")
|
||||
}
|
||||
|
||||
log.Info().Msg("database restored to previous version")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue