Skip to content

Releases: pressly/goose

v3.24.0

19 Dec 16:08
v3.24.0
bfb3550
Compare
Choose a tag to compare

What's Changed

  • Add support for loading environment variables from .env files, enabled by default. by @rwwwx in #864
    • The default file name is .env, but can be changed with the -env=<filename> flag.
    • To disable this feature, set -env=none.
  • fix: CVE-2024-45338 in golang.org/x/net bump to v0.33.0 by @k2589 in #880

New Contributors

Full Changelog: v3.23.1...v3.24.0

v3.23.1

12 Dec 15:23
v3.23.1
1a5b755
Compare
Choose a tag to compare

What's Changed

  • feat: postgres migration table existence check by @mfridman in #860

    • Store implementations can optionally implement the TableExists method to provide optimized
      table existence checks (#860)
    • Default postgres Store implementation updated to use pg_tables system catalog, more to follow

    • Backward compatible change - existing implementations will continue to work without modification

      TableExists(ctx context.Context, db database.DBTxConn) (bool, error)
  • Update README - examply mssql connection string by @alex9311 in #866

  • fix: CVE-2024-45337 in golang.org/x/crypto bump to v0.31.0 by @k2589 in #871

New Contributors

Full Changelog: v3.23.0...v3.23.1

v3.23.0

21 Nov 14:31
v3.23.0
8d88226
Compare
Choose a tag to compare

What's Changed

  • Add WithLogger to NewProvider to allow custom loggers (#833)
  • Update Provider WithVerbose behavior to log all SQL statements (#851)
  • Upgrade dependencies and rebuild binaries with latest Go version (go1.23.3)

New Contributors

Full Changelog: v3.22.1...v3.23.0

v3.22.1

17 Sep 12:43
v3.22.1
d994786
Compare
Choose a tag to compare
  • Upgrade dependencies and rebuild binaries with latest Go version (go1.23.1)

v3.22.0

03 Sep 12:26
v3.22.0
5193dcb
Compare
Choose a tag to compare

Changelog

  • Minimum Go version is now 1.21

  • Add Unwrap to PartialError (#815)

  • Allow flags anywhere on the CLI (#814)

    goose uses the default Go flag parsing library, which means flags must be defined before the
    first positional argument. We've updated this behavior to allow flags to be defined anywhere. For
    more details, see blog post.

  • Update WithDisableGlobalRegistry behavior (#783). When set, this will ignore globally-registered
    migrationse entirely instead of the previous behavior of raising an error.

    This enables creating isolated goose provider(s) in legacy environments where global migrations may
    be registered. Without updating this behavior, it would be impossible to use
    WithDisableGlobalRegistry in combination with provider-scoped WithGoMigrations.

    Specifically, the following check is removed:

if len(global) > 0 {
  return nil, errors.New("global registry disabled, but provider has registered go migrations")
}
  • Postgres, updated schema to use identity instead of serial and make tstamp not nullable (#556)
- id serial NOT NULL,
+ id integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,

- tstamp timestamp NULL default now(),
+ tstamp timestamp NOT NULL DEFAULT now()
  • MySQL, updated schema to not use SERIAL alias (#816)
- id serial NOT NULL,
+ id bigint(20) unsigned NOT NULL AUTO_INCREMENT,

v3.21.1

19 Jun 14:14
v3.21.1
3ad1378
Compare
Choose a tag to compare
  • Add GetVersions method to goose.Provider, returns the current (max db) version and the latest
    (max filesystem) version. (#756)
  • Clarify GetLatestVersion method MUST return ErrVersionNotFound if no latest migration is
    found. Previously it was returning a -1 and nil error, which was inconsistent with the rest of the
    API surface.
  • Add GetLatestVersion implementations to all existing dialects. This is an optimization to avoid
    loading all migrations when only the latest version is needed. This uses the max function in SQL
    to get the latest version_id irrespective of the order of applied migrations.
    • Refactor existing portions of the code to use the new GetLatestVersion method.

Note, v3.21.0 was retracted due to a reported user issue #779 with Go modules and replace directives when using go run, hence the patch bump to v3.21.1.

v3.21.0

19 Jun 12:57
v3.21.0
7da8209
Compare
Choose a tag to compare

Caution

Retracted, please use v3.21.1 instead.

v3.20.0

22 Apr 13:18
v3.20.0
31de74d
Compare
Choose a tag to compare

What's Changed

  • Expand the Store interface by adding a GetLatestVersion method 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 .UpTo from goose.Provider will invoke .HasPending before
    acquiring a lock with SessionLocker (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 #507 (comment) and #751.
  • Move integration tests to ./internal/testing and 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.

v3.19.2

13 Mar 13:46
v3.19.2
79be9af
Compare
Choose a tag to compare
  • Remove duckdb support. The driver uses Cgo and we've decided to remove it until we can find a
    better solution. If you were using duckdb with goose, please let us know by opening an issue.

v3.19.1

11 Mar 14:26
v3.19.1
9024628
Compare
Choose a tag to compare
  • Fix selecting dialect for redshift
  • Add GOOSE_MIGRATION_DIR documentation
  • Bump github.com/opencontainers/runc to v1.1.12 (security fix)
  • Update CI tests for go1.22
  • Make goose annotations case-insensitive
    • All -- +goose annotations are now case-insensitive. This means that -- +goose Up and -- +goose up are now equivalent. This change was made to improve the user experience and to make the annotations more consistent.

New Contributors

  • @jbking made their first contribution in #692
  • @JosefuMealsom made their first contribution in #697
  • @dpeckett made their first contribution in #696 (currently disabled until build is resolved, uses CGO. But thank you for the contribution 😄)
  • @obalunenko made their first contribution in #704