mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
migsets: rename post migration callbacks mentions
With the latest version of the `sqldb/v2` & `migrate` packages, Post Migration Callbacks were renamed to Programmatic Migrations. Our previous codebase still had some mentions of Post Migration Callbacks, and therefore we rename those to use the word Programmatic Migrations instead.
This commit is contained in:
parent
e47348680f
commit
3d8779693a
2 changed files with 12 additions and 17 deletions
|
|
@ -22,11 +22,9 @@ import (
|
|||
"github.com/lightningnetwork/lnd/sqldb/v2"
|
||||
)
|
||||
|
||||
// MakePostStepCallbacksMig6 turns the post migration checks into a map of post
|
||||
// step callbacks that can be used with the migrate package. The keys of the map
|
||||
// are the migration versions, and the values are the callbacks that will be
|
||||
// executed after the migration with the corresponding version is applied.
|
||||
func MakePostStepCallbacksMig6(ctx context.Context,
|
||||
// Mig6ProgrammaticMigration generates and returns the programmatic migration
|
||||
// entry containing the kvdb to SQL migration for all of litd's database stores.
|
||||
func Mig6ProgrammaticMigration(ctx context.Context,
|
||||
basicClient lnrpc.LightningClient, db *sqldb.BaseDB,
|
||||
macPath string, clock clock.Clock,
|
||||
migVersion uint) migrate.ProgrammaticMigrEntry {
|
||||
|
|
@ -46,10 +44,10 @@ func MakePostStepCallbacksMig6(ctx context.Context,
|
|||
err := mig6executor.ExecTx(
|
||||
ctx, sqldb.WriteTxOpt(),
|
||||
func(q6 *sqlcmig6.Queries) error {
|
||||
log.Infof("Running post migration callback "+
|
||||
log.Infof("Running the programmatic migration "+
|
||||
"for migration version %d", migVersion)
|
||||
|
||||
return kvdbToSqlMigrationCallback(
|
||||
return kvdbToSqlProgrammaticMigration(
|
||||
ctx, basicClient, macPath, db, clock,
|
||||
q6,
|
||||
)
|
||||
|
|
@ -88,7 +86,7 @@ func MakePostStepCallbacksMig6(ctx context.Context,
|
|||
}
|
||||
}
|
||||
|
||||
func kvdbToSqlMigrationCallback(ctx context.Context,
|
||||
func kvdbToSqlProgrammaticMigration(ctx context.Context,
|
||||
basicClient lnrpc.LightningClient, macPath string, _ *sqldb.BaseDB,
|
||||
clock clock.Clock, q *sqlcmig6.Queries) error {
|
||||
|
||||
|
|
@ -64,17 +64,14 @@ func MakeMigrationSets(ctx context.Context,
|
|||
MakeProgrammaticMigrations: func(db *sqldb.BaseDB) (
|
||||
map[uint]migrate.ProgrammaticMigrEntry, error) {
|
||||
|
||||
// Any Callbacks added to this map will be executed when
|
||||
// after the dev migration number for the uint key in
|
||||
// the map has been applied. If no entry exists for a
|
||||
// given uint, then no callback will be executed for
|
||||
// that migration number. This is useful for adding a
|
||||
// code migration step as a callback to be run
|
||||
// after a specific migration of a given number has been
|
||||
// applied.
|
||||
// Any programmatic migrations added to this map will be
|
||||
// executed when the dev migration number for the uint
|
||||
// key is applied. If no entry exists for a
|
||||
// given uint, then no programmatic migration will be
|
||||
// executed for that migration number.
|
||||
res := make(map[uint]migrate.ProgrammaticMigrEntry)
|
||||
|
||||
res[KVDBtoSQLMigVersion] = MakePostStepCallbacksMig6(
|
||||
res[KVDBtoSQLMigVersion] = Mig6ProgrammaticMigration(
|
||||
ctx, basicClient, db, macPath, clock,
|
||||
KVDBtoSQLMigVersion,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue