DB upgrade failes if bucket does not exists (#6608)

pull/6611/head
Prabhat Khera 2022-03-01 10:31:33 +13:00 committed by GitHub
parent 9f4549212d
commit 14ed6ed2a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -407,6 +407,9 @@ func (connection *DbConnection) RestoreMetadata(s map[string]interface{}) error
err = connection.Batch(func(tx *bolt.Tx) error {
bucket := tx.Bucket([]byte(bucketName))
if bucket == nil {
return nil
}
return bucket.SetSequence(uint64(id))
})
}