Skip to content

Commit

Permalink
Release v3.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mfridman committed Dec 16, 2023
1 parent 8d6618d commit 87c45a3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ⚠️

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion goose.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 87c45a3

Please sign in to comment.