Release v3.17.0

pull/671/head v3.17.0
Mike Fridman 2023-12-15 23:52:17 -05:00
parent 8d6618d145
commit 87c45a3677
No known key found for this signature in database
3 changed files with 13 additions and 4 deletions

View File

@ -7,12 +7,15 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [v3.17.0] - 2023-12-15
- Standardised the MIT license (#647)
- Improve provider `Apply()` errors, add `ErrNotApplied` when attempting to rollback a migration
that has not been previously applied. (#660)
- Add `WithDisableGlobalRegistry` option to `NewProvider` to disable the global registry. (#645)
- Add `-timeout` flag to CLI to set the maximum allowed duration for queries to run. Default remains
no timeout. (#627)
- Add optional logging in `Provider` when `WithVerbose` option is supplied. (#668)
⚠️ Potential Breaking Change ⚠️
@ -98,7 +101,8 @@ Here's a quick summary:
- Add new `context.Context`-aware functions and methods, for both sql and go migrations.
- Return error when no migration files found or dir is not a directory.
[Unreleased]: https://github.com/pressly/goose/compare/v3.16.0...HEAD
[Unreleased]: https://github.com/pressly/goose/compare/v3.17.0...HEAD
[v3.17.0]: https://github.com/pressly/goose/compare/v3.16.0...v3.17.0
[v3.16.0]: https://github.com/pressly/goose/compare/v3.15.1...v3.16.0
[v3.15.1]: https://github.com/pressly/goose/compare/v3.15.0...v3.15.1
[v3.15.0]: https://github.com/pressly/goose/compare/v3.14.0...v3.15.0

View File

@ -9,7 +9,7 @@ import (
)
// Deprecated: VERSION will no longer be supported in the next major release.
const VERSION = "v3.2.0"
const VERSION = "v3.17.0"
var (
minVersion = int64(0)

View File

@ -116,8 +116,13 @@ func newProvider(
for version, m := range cfg.registered {
versionToGoMigration[version] = m
}
// Do not add globally registered Go migrations if explicitly disabled.
if !cfg.disableGlobalRegistry {
// Return an error if the global registry is explicitly disabled, but there are registered Go
// migrations.
if cfg.disableGlobalRegistry {
if len(global) > 0 {
return nil, errors.New("global registry disabled, but provider has registered go migrations")
}
} else {
for version, m := range global {
if _, ok := versionToGoMigration[version]; ok {
return nil, fmt.Errorf("global go migration with version %d previously registered with provider", version)