* Let database.Open() use schemeFromURL as well
Otherwise it will fail on MySQL DSNs.
Moved schemeFromURL into the database package. Also removed databaseSchemeFromURL
and sourceSchemeFromURL as they were just calling schemeFromURL.
Fixes https://github.com/golang-migrate/migrate/pull/265#issuecomment-522301237
* Moved url functions into internal/url
Also merged the test cases.
* Add some database tests to improve coverage
* Fix suggestions
* NewDockerContainer: restore "from env" behavior
commit c31948caeb replaced the deprecated
`dockerclient.NewEnvClient` with `dockerclient.NewClientWithOpts`, but
did not add the `FromEnv` option to keep the old behavior.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* NewDockerContainer: use API version negotiation
This helps in situations where the daemon is older than
the API client. API version negotiation checks the maximum
supported API version by the daemon, and downgrades to that
API version if needed.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Fix in the URL parser with go 1.12.8 and github.com/go-sql-driver/mysql
Change schemeFromURL to just split the url by :// to find the scheme.
It's not required to parse the whole URL. MySQL DSNs aren't valid URLs.
Fixes#264
* The mysql driver itself also used net/url.Parse
* Also fix TestPasswordUnencodedReservedURLChars
* Keep backwards compatibility with url encoded username and passwords
* Fix suggestions
* Reuse old function names
The default exit status when a command cannot be found was 0.
This can cause migrate to fail "silently" in case of typos.
Given that providing an invalid flag causes the program to exit
with a exit status set to 2, the default exit status was also set to 2.
default behaviour for down is to apply all down migrations, which is
comparable to dropping a database - and usually not the desired default
action
proposed changes:
* `down` prompts for a confirm `y` before applying all down migrations, defaulting to doing nothing
* `down --all` does the current behaviour, applying all down migrations
* `down N` is unchanged
* `down N --all` errors
* `down --all N` errors