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

Cleanup config parsing and database migration errors #21

Merged
merged 1 commit into from
May 22, 2018

Conversation

elliott-davis
Copy link
Contributor

The long and the short of this is there were multiple errors with parsing configs and running migrations.

What you need to know:

There is a patched vendor file (shame on me, I know). However, being the nice netizen that I am, I made a PR upstream golang-migrate/migrate#36

The other stuff is mostly cleanup around how viper serializes config files and some bad quoting on my part in originsrv.

Signed-off-by: Elliott Davis [email protected]

@@ -18,5 +18,5 @@ func Migrate(db *sql.DB, migrations_dir string) {
m, err := migrate.NewWithDatabaseInstance(
fmt.Sprintf("file://%s", migrations_dir),
"postgres", driver)
m.Up()
m.Steps(0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Steps(0) here, but Up() below in sessionsrv?

@@ -70,8 +70,8 @@ func initConfig() {
}

// DBConfigFromViper fetches database config from viper
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is wrong now, given the function name change.

Copy link
Member

@raskchanky raskchanky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments, but looks good overall

The long and the short of this is there were multiple errors with parsing configs and running migrations.

What you need to know:

There is a patched vendor file (shame on me, I know). However, being the nice netizen that I am, I made a PR upstream golang-migrate/migrate#36

The other stuff is mostly cleanup around how viper serializes config files and some bad quoting on my part in originsrv.

Signed-off-by: Elliott Davis <[email protected]>
@elliott-davis elliott-davis force-pushed the elliott/cleanupening branch from 70943cf to d4d1efc Compare May 22, 2018 12:33
@elliott-davis elliott-davis merged commit 904a2fc into master May 22, 2018
@elliott-davis elliott-davis deleted the elliott/cleanupening branch May 22, 2018 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants