mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 21:07:18 +00:00
0d818a5709
* wip * migration happening * wip * fix memory utilization, add the testcases * migration issues * the gazel * remove debug logging * goimport * gazel
28 lines
476 B
Go
28 lines
476 B
Go
package kv
|
|
|
|
import (
|
|
"context"
|
|
|
|
bolt "go.etcd.io/bbolt"
|
|
)
|
|
|
|
var migrationCompleted = []byte("done")
|
|
|
|
type migration func(context.Context, *bolt.DB) error
|
|
|
|
var migrations = []migration{
|
|
migrateArchivedIndex,
|
|
migrateBlockSlotIndex,
|
|
migrateStateValidators,
|
|
}
|
|
|
|
// RunMigrations defined in the migrations array.
|
|
func (s *Store) RunMigrations(ctx context.Context) error {
|
|
for _, m := range migrations {
|
|
if err := m(ctx, s.db); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|