fix(database): migrations log correct upgrade var version (#1441)

* fix(database): correct upgrade var

* fix(database): substitute len(var) with i+1
This commit is contained in:
martylukyy 2024-02-28 18:04:45 +01:00 committed by GitHub
parent 6b37c13da7
commit 2cdd3264b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -39,7 +39,7 @@ func (db *DB) openSQLite() error {
}
// SQLite has a query planner that uses lifecycle stats to fund optimizations.
// This restricts the SQLite query planner optimizer to only run if sufficient
// This restricts the SQLite query planner optimizer to only run if sufficient
// information has been gathered over the lifecycle of the connection.
// The SQLite documentation is inconsistent in this regard,
// suggestions of 400 and 1000 are both "recommended", so lets use the lower bound.
@ -125,7 +125,7 @@ func (db *DB) migrateSQLite() error {
}
} else {
for i := version; i < len(sqliteMigrations); i++ {
db.log.Info().Msgf("Upgrading Database schema to version: %v", i)
db.log.Info().Msgf("Upgrading Database schema to version: %v", i+1)
if _, err := tx.Exec(sqliteMigrations[i]); err != nil {
return errors.Wrap(err, "failed to execute migration #%v", i)
}