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

Added ability to change db version table name #104

Merged
merged 2 commits into from
May 3, 2018

Conversation

chapsuk
Copy link
Contributor

@chapsuk chapsuk commented Apr 29, 2018

Hi, guys!

Change db version table name would be useful in some cases:

  • follow the internal rules for tables naming
  • seeding db by goose for dev/test environments

Thanks!

Copy link
Collaborator

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

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

LGTM. Minor suggestion

version.go Outdated

// SetDBVersionTableName set goose db version table name
func SetDBVersionTableName(n string) {
dbVersionTableName = n
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we call it simply "tableName" in all the above occurrences?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my opinion this is a bit ambiguous and can be misleading.
may be versionTable ?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh no, your are right! goose.TableName is ok

Copy link
Collaborator

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

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

LGTM.

Can you verify you can see only one occurrence of git grep goose_db_version right now? Just wanna make sure we don't have any left-overs anywhere.

@chapsuk
Copy link
Contributor Author

chapsuk commented May 3, 2018

Sure:

≻ git grep goose_db_version
Binary file examples/go-migrations/foo.db matches
Binary file examples/go-migrations/goose matches
version.go:var tableName = "goose_db_version"

@VojtechVitek VojtechVitek merged commit 95600eb into pressly:master May 3, 2018
@VojtechVitek
Copy link
Collaborator

Thanks for your contribution. I just released v2.3.0.

@chapsuk chapsuk deleted the table_name branch May 3, 2018 18:59
@chapsuk
Copy link
Contributor Author

chapsuk commented May 3, 2018

Thank you so much!

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.

None yet

2 participants