From 87c45a36779ef9413ab6080f62e3c4112c919fa4 Mon Sep 17 00:00:00 2001 From: Mike Fridman Date: Fri, 15 Dec 2023 23:52:17 -0500 Subject: [PATCH] Release v3.17.0 --- CHANGELOG.md | 6 +++++- goose.go | 2 +- provider.go | 9 +++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15a6f248e..fb9a8ba7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/goose.go b/goose.go index fc42dbfae..ddffd8c28 100644 --- a/goose.go +++ b/goose.go @@ -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) diff --git a/provider.go b/provider.go index 5826c80b7..24a9eb5a7 100644 --- a/provider.go +++ b/provider.go @@ -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)