// 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.