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

handle 10.1 version #27

Merged
merged 1 commit into from
Jan 27, 2018
Merged

Conversation

bill-kitsune
Copy link
Contributor

@bill-kitsune bill-kitsune commented Jan 27, 2018

When running db-migrate against postgreSQL running in a docker container I noticed that running migrations twice would fail on an error saying that the migration table already exists.

This is because the regex that was being used to determine the version was incorrectly grabbing a different semver from the string returned by the query. This is in part to postgreSQL 10.1 not including the patch number with it's version.

In my case the string returned was PostgreSQL 10.1 on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18) 6.3.0 20170516, 64-bit

When running on osx the string returned from the query was PostgreSQL 10.1 on x86_64-apple-darwin17.2.0, compiled by Apple LLVM version 9.0.0 (clang-900.0.38), 64-bit. The match however succeeded because the regex matched on the darwin version 17.2.0 NOT the postgreSQL version.

I replaced the query with show server_version which returns just the semver.

@ghost
Copy link

ghost commented Jan 27, 2018

There were the following issues with this Pull Request

  • Commit: 523d4f3
    • ✖ message may not be empty
    • ✖ type may not be empty

You may need to change the commit messages to comply with the repository contributing guidelines.


🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding!

@ghost
Copy link

ghost commented Jan 27, 2018

There were the following issues with this Pull Request

  • Commit: 193faff
    • ✖ message may not be empty
    • ✖ type may not be empty

You may need to change the commit messages to comply with the repository contributing guidelines.


🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding!

Signed-off-by: William F Wheeler II <bill@quickbrownfoxlabs.com>
@wzrdtales
Copy link
Member

Thanks for your contribution! 🎉

@wzrdtales
Copy link
Member

I just quickly checked if this would break drivers working on the pg wire protocol, such as cockroachdb. Seems to work just fine.

@wzrdtales wzrdtales merged commit c1a2737 into db-migrate:master Jan 27, 2018
@wzrdtales wzrdtales mentioned this pull request Feb 12, 2018
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