What's Changed
- Expand the
Storeinterface by adding aGetLatestVersionmethod and make the interface public. - Add a (non-blocking) method to check if there are pending migrations to the
goose.Provider(#751):
func (p *Provider) HasPending(context.Context) (bool, error) {}NOTE
The underlying implementation does not respect the
SessionLocker(if one is enabled) and can be used to check for pending migrations without blocking or being blocked by other operations.
- The methods
.Up,.UpByOne, and.UpTofromgoose.Providerwill invoke.HasPendingbefore acquiring a lock withSessionLocker(if enabled). This addresses an edge case in Kubernetes-style deployments where newer pods with long-running migrations prevent older pods - which have all known migrations applied - from starting up due to an advisory lock. For more details, refer to https://github.com/pressly/goose/pull/507#discussion_r1266498077 and #751. - Move integration tests to
./internal/testingand make it a separate Go module. This will allow us to have a cleaner top-level go.mod file and avoid imports unrelated to the goose project. See integration/README.md for more details. This shouldn't affect users of the goose library.