A database migration tool. Supports SQL migrations and Go functions.
Fixed a bunch of build issues, see https://github.com/pressly/goose/releases/tag/v3.13.4 for correct changelog.
up
and up -allowing-missing
behavior.context.Context
-aware functions and methods, for both sql and go migrations.Note, tags v3.12.0
, v3.12.1
, v3.12.2
have been retracted because they contained the wrong module reference, please use the current release v3.13.0
onwards. Apologies for the inconvenience.
Full Changelog: https://github.com/pressly/goose/compare/v3.11.2...v3.13.0
Full Changelog: https://github.com/pressly/goose/compare/v3.11.0...v3.11.2
goose validate
.. enables you to validate your SQL / Go migrations. Very handy for catching errors in CI when the migration is first writtentls
override in MySQL DSNset mutations_sync 2
for synchronizationgoose validate
command (#449) (@mfridman)tls
override from mysql dsn normalizing (#468) (@jonas-jonas)*sql.DB
-registered Go migrations (#450). Kudos to @cbodonnell for helping with this feature.There are 2 new func types:
// GoMigration is a Go migration func that is run within a transaction.
type GoMigration func(tx *sql.Tx) error
// GoMigrationNoTx is a Go migration func that is run outside a transaction.
type GoMigrationNoTx func(db *sql.DB) error
And 2 new functions to register Go migrations:
// AddMigrationNoTx adds Go migrations that will be run outside transaction.
func AddMigrationNoTx(up, down GoMigrationNoTx) { ... }
// AddNamedMigrationNoTx adds named Go migrations that will be run outside transaction.
func AddNamedMigrationNoTx(filename string, up, down GoMigrationNoTx) { ... }
goose env
command to expose set environment variables (#443)