mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
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:
parent
6b37c13da7
commit
2cdd3264b8
2 changed files with 3 additions and 3 deletions
|
@ -71,7 +71,7 @@ func (db *DB) migratePostgres() error {
|
|||
}
|
||||
} else {
|
||||
for i := version; i < len(postgresMigrations); 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(postgresMigrations[i]); err != nil {
|
||||
return errors.Wrap(err, "failed to execute migration #%v", i)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue