From eb6cdf1229adaded4437321f9520d3d2e198c132 Mon Sep 17 00:00:00 2001 From: Prabhat Khera <91852476+prabhat-org@users.noreply.github.com> Date: Thu, 3 Mar 2022 09:10:26 +1300 Subject: [PATCH] created bucket if not exists during restore sequence (#6614) --- api/database/boltdb/db.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/database/boltdb/db.go b/api/database/boltdb/db.go index 61626ee47..e8d52286b 100644 --- a/api/database/boltdb/db.go +++ b/api/database/boltdb/db.go @@ -419,9 +419,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 + bucket, err := tx.CreateBucketIfNotExists([]byte(bucketName)) + if err != nil { + return err } return bucket.SetSequence(uint64(id)) })