Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.