Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services/horizon: Fix some bugs in db migrate commands #3762

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions services/horizon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
All notable changes to this project will be documented in this
file. This project adheres to [Semantic Versioning](http://semver.org/).

## v2.6.1

**Upgrading to this version from <= v2.5.2 will trigger a state rebuild. During this process (which will take at least 10 minutes), Horizon will not ingest new ledgers.**

* Fix bug introduced in v2.6.0 ([#3737](https://github.com/stellar/go/pull/3737)), preventing usage of `horizon db migrate up/down/redo` commands. ([#3762](https://github.com/stellar/go/pull/3762))

## v2.6.0

Expand Down
6 changes: 3 additions & 3 deletions services/horizon/cmd/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func migrate(dir schema.MigrateDir, count int) {
log.Fatal(err)
}

numMigrationsRun, err := schema.Migrate(dbConn.DB.DB, schema.MigrateRedo, count)
numMigrationsRun, err := schema.Migrate(dbConn.DB.DB, dir, count)
if err != nil {
log.Fatal(err)
}
Expand All @@ -99,7 +99,7 @@ var dbMigrateDownCmd = &cobra.Command{
os.Exit(1)
}

count, err := strconv.Atoi(args[1])
count, err := strconv.Atoi(args[0])
if err != nil {
log.Println(err)
cmd.Usage()
Expand All @@ -123,7 +123,7 @@ var dbMigrateRedoCmd = &cobra.Command{
os.Exit(1)
}

count, err := strconv.Atoi(args[1])
count, err := strconv.Atoi(args[0])
if err != nil {
log.Println(err)
cmd.Usage()
Expand Down