mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
b382f96f6c
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
27 lines
672 B
Go
27 lines
672 B
Go
package migrations
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/ledgerwatch/erigon-lib/common/datadir"
|
|
"github.com/ledgerwatch/erigon-lib/kv"
|
|
"github.com/ledgerwatch/log/v3"
|
|
)
|
|
|
|
var dbSchemaVersion5 = Migration{
|
|
Name: "db_schema_version5",
|
|
Up: func(db kv.RwDB, dirs datadir.Dirs, progress []byte, BeforeCommit Callback, logger log.Logger) (err error) {
|
|
tx, err := db.BeginRw(context.Background())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer tx.Rollback()
|
|
|
|
// This migration is no-op, but it forces the migration mechanism to apply it and thus write the DB schema version info
|
|
if err := BeforeCommit(tx, nil, true); err != nil {
|
|
return err
|
|
}
|
|
return tx.Commit()
|
|
},
|
|
}
|