mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
multi: rename MigrationStream names to MigrationSet
This commit is contained in:
parent
10337691cb
commit
f78ddf1702
11 changed files with 34 additions and 35 deletions
|
|
@ -24,14 +24,14 @@ const (
|
|||
LatestDevMigrationVersion = 1
|
||||
)
|
||||
|
||||
// MakeTestMigrationStreams creates the migration streams for the unit test
|
||||
// MakeTestMigrationSets creates the migration sets for the unit test
|
||||
// environment.
|
||||
//
|
||||
// NOTE: This function is not located in the migstreams package to avoid
|
||||
// cyclic dependencies. This test migration stream does not run the kvdb to sql
|
||||
// cyclic dependencies. This test migration set does not run the kvdb to sql
|
||||
// migration, as we already have separate unit tests which tests the migration.
|
||||
func MakeTestMigrationStreams() []sqldb.MigrationSet {
|
||||
migStream := sqldb.MigrationSet{
|
||||
func MakeTestMigrationSets() []sqldb.MigrationSet {
|
||||
migSet := sqldb.MigrationSet{
|
||||
TrackingTableName: pgx.DefaultMigrationsTable,
|
||||
SQLFileDirectory: "sqlc/migrations",
|
||||
SQLFiles: SqlSchemas,
|
||||
|
|
@ -50,7 +50,7 @@ func MakeTestMigrationStreams() []sqldb.MigrationSet {
|
|||
},
|
||||
}
|
||||
|
||||
migStreamDev := sqldb.MigrationSet{
|
||||
migSetDev := sqldb.MigrationSet{
|
||||
TrackingTableName: pgx.DefaultMigrationsTable + "_dev",
|
||||
SQLFileDirectory: "sqlc/migrations_dev",
|
||||
SQLFiles: SqlSchemas,
|
||||
|
|
@ -69,5 +69,5 @@ func MakeTestMigrationStreams() []sqldb.MigrationSet {
|
|||
},
|
||||
}
|
||||
|
||||
return []sqldb.MigrationSet{migStream, migStreamDev}
|
||||
return []sqldb.MigrationSet{migSet, migSetDev}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,14 +13,13 @@ import (
|
|||
"github.com/lightningnetwork/lnd/sqldb/v2"
|
||||
)
|
||||
|
||||
// MakeMigrationStreams creates the migration streams for production
|
||||
// environments.
|
||||
func MakeMigrationStreams(_ context.Context, _ lnrpc.LightningClient, _ string,
|
||||
// MakeMigrationSets creates the migration sets for production environments.
|
||||
func MakeMigrationSets(_ context.Context, _ lnrpc.LightningClient, _ string,
|
||||
_ clock.Clock) []sqldb.MigrationSet {
|
||||
|
||||
// migStream defines the SQL migration stream used to create
|
||||
// and upgrade LiT's SQL schema.
|
||||
migStream := sqldb.MigrationSet{
|
||||
// migSet defines the SQL migration set used to create and upgrade LiT's
|
||||
// SQL schema.
|
||||
migSet := sqldb.MigrationSet{
|
||||
TrackingTableName: pgx.DefaultMigrationsTable,
|
||||
SQLFileDirectory: "sqlc/migrations",
|
||||
SQLFiles: db.SqlSchemas,
|
||||
|
|
@ -39,5 +38,5 @@ func MakeMigrationStreams(_ context.Context, _ lnrpc.LightningClient, _ string,
|
|||
},
|
||||
}
|
||||
|
||||
return []sqldb.MigrationSet{migStream}
|
||||
return []sqldb.MigrationSet{migSet}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ const (
|
|||
KVDBtoSQLMigVersion = 1
|
||||
)
|
||||
|
||||
// MakeMigrationStreams creates the migration streams for the dev environments.
|
||||
func MakeMigrationStreams(ctx context.Context,
|
||||
// MakeMigrationSets creates the migration sets for the dev environments.
|
||||
func MakeMigrationSets(ctx context.Context,
|
||||
basicClient lnrpc.LightningClient, macPath string,
|
||||
clock clock.Clock) []sqldb.MigrationSet {
|
||||
|
||||
// Create the prod migration stream.
|
||||
migStream := sqldb.MigrationSet{
|
||||
// Create the prod migration set.
|
||||
migSet := sqldb.MigrationSet{
|
||||
TrackingTableName: pgx.DefaultMigrationsTable,
|
||||
SQLFileDirectory: "sqlc/migrations",
|
||||
SQLFiles: db.SqlSchemas,
|
||||
|
|
@ -48,8 +48,8 @@ func MakeMigrationStreams(ctx context.Context,
|
|||
},
|
||||
}
|
||||
|
||||
// Create the dev migration stream.
|
||||
migStreamDev := sqldb.MigrationSet{
|
||||
// Create the dev migration set.
|
||||
migSetDev := sqldb.MigrationSet{
|
||||
TrackingTableName: pgx.DefaultMigrationsTable + "_dev",
|
||||
SQLFileDirectory: "sqlc/migrations_dev",
|
||||
SQLFiles: db.SqlSchemas,
|
||||
|
|
@ -83,5 +83,5 @@ func MakeMigrationStreams(ctx context.Context,
|
|||
},
|
||||
}
|
||||
|
||||
return []sqldb.MigrationSet{migStream, migStreamDev}
|
||||
return []sqldb.MigrationSet{migSet, migSetDev}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,6 @@ func NewTestPostgresDB(t *testing.T) *sqldb.PostgresStore {
|
|||
})
|
||||
|
||||
return sqldb.NewTestPostgresDB(
|
||||
t, sqlFixture, MakeTestMigrationStreams(),
|
||||
t, sqlFixture, MakeTestMigrationSets(),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue