Skip to content

Commit

Permalink
Merge pull request #92 from ethpandaops/pk910/out-of-order-db-upgrades
Browse files Browse the repository at this point in the history
allow out of order db schema upgrades
  • Loading branch information
pk910 authored Aug 16, 2024
2 parents ec7cf06 + 4ac0696 commit 09d6691
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions db/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ func ApplyEmbeddedDbSchema(version int64) error {
}

if version == -2 {
if err := goose.Up(writerDb.DB, schemaDirectory); err != nil {
if err := goose.Up(writerDb.DB, schemaDirectory, goose.WithAllowMissing()); err != nil {
return err
}
} else if version == -1 {
if err := goose.UpByOne(writerDb.DB, schemaDirectory); err != nil {
if err := goose.UpByOne(writerDb.DB, schemaDirectory, goose.WithAllowMissing()); err != nil {
return err
}
} else {
if err := goose.UpTo(writerDb.DB, schemaDirectory, version); err != nil {
if err := goose.UpTo(writerDb.DB, schemaDirectory, version, goose.WithAllowMissing()); err != nil {
return err
}
}
Expand Down

0 comments on commit 09d6691

Please sign in to comment.