returnnil,errors.New("found schema name for the second time when looking for migrations")
returnnil,errors.New("found schema name for the second time when looking for migrations")
}
}
foundCurrent=true
foundCurrent=true
db.logger.Infof("localstore migration: found current localstore schema %s, migrate to %s, total migrations %d",currentSchema,DbSchemaCurrent,len(allSchemeMigrations)-i)
db.logger.Infof("localstore migration: found current localstore schema %s, migrate to %s, total migrations %d",currentSchema,DBSchemaCurrent,len(allSchemeMigrations)-i)
continue// current schema migration should not be executed (already has been when schema was migrated to)
continue// current schema migration should not be executed (already has been when schema was migrated to)
returnerrors.New("failed to update your node due to the existence of pinned content. Please refer to the release notes on how to safely migrate your pinned content.")
}
// define the old indexes from the previous schema
// Copyright 2021 The Swarm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
packagelocalstore
import(
"encoding/binary"
"errors"
"fmt"
"time"
"github.com/ethersphere/bee/pkg/shed"
"github.com/ethersphere/bee/pkg/swarm"
)
// DBSchemaBatchIndex is the bee schema identifier for batch index.
constDBSchemaBatchIndex="batch-index"
// migrateBatchIndex removes all existing database content, unless pinned
// content is detected, in which case it aborts the operation for the user to
// resolve.
funcmigrateBatchIndex(db*DB)error{
has,err:=db.stateStoreHasPins()
iferr!=nil{
returnerr
}
ifhas{
returnerrors.New("failed to update your node due to the existence of pinned content; please refer to the release notes on how to safely migrate your pinned content")
}
// Define the old indexes from the previous schema and swipe them clean.
returnerrors.New("failed to update your node due to the existence of pinned content; please refer to the release notes on how to safely migrate your pinned content")
}
// Define the old indexes from the previous schema and swipe them clean.