What changed, and why it matters
This is a small code cleanup in LND's database layer. It changes how two database types (Postgres and SQLite) check whether to skip running schema migrations. Previously they looked at a setting inside their configuration object; now they look at a flag on a shared base database object. The commit message says this makes behavior consistent across both database backends. There is no direct evidence in the commit that this fixes a security vulnerability, but inconsistent migration handling can in principle lead to operational or state-integrity problems.
Treat as a routine maintenance/correctness patch. Review whether the BaseDB SkipMigrations field is initialized consistently everywhere and whether any caller previously relied on the config-level flag being honored independently. No immediate security response is indicated by the commit alone.
Security signals we found
Migration skip flag moved from per-backend config to shared BaseDB field
Behavioral consistency fix across Postgres and SQLite migration paths
No explicit security framing by vendor in commit or title
Evidence from the diff
The patch modifies sqldb/v2/postgres.go and sqldb/v2/sqlite.go so that ExecuteMigrations consults s.SkipMigrations (a field on BaseDB) instead of s.cfg.SkipMigrations / s.Config.SkipMigrations. The stated intent is to route migration skipping through the BaseDB field that each store already initializes, making embedded state meaningful and keeping runtime migration behavior consistent across Postgres and SQLite backends. The diff is a two-line change with no new tests or additional logic.
Changed components
sqldb/v2/postgres.gosqldb/v2/sqlite.goBaseDB migration skip flagInspect captured patch +2 / −2
diff --git a/sqldb/v2/postgres.go b/sqldb/v2/postgres.go
index e3753dc..ef60992 100644
--- a/sqldb/v2/postgres.go
+++ b/sqldb/v2/postgres.go
@@ -216,7 +216,7 @@ func errPostgresMigration(err error) error {
// ExecuteMigrations runs migrations for the Postgres database using the
// default production migration target.
func (s *PostgresStore) ExecuteMigrations(set MigrationSet) error {
- if s.cfg.SkipMigrations {
+ if s.SkipMigrations {
return nil
}
diff --git a/sqldb/v2/sqlite.go b/sqldb/v2/sqlite.go
index 8967ff5..255f8e4 100644
--- a/sqldb/v2/sqlite.go
+++ b/sqldb/v2/sqlite.go
@@ -249,7 +249,7 @@ func (s *SqliteStore) backupAndMigrate(mig *migrate.Migrate,
// ExecuteMigrations runs migrations for the sqlite database using the default
// production migration target.
func (s *SqliteStore) ExecuteMigrations(set MigrationSet) error {
- if s.Config.SkipMigrations {
+ if s.SkipMigrations {
return nil
}
Why this scored 27/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.