v3.18.0
v3.18.0
(current release) the minimum supported Go version is go1.20
New features
-
Add environment variable substitution for SQL migrations. (#604)
-
This feature is disabled by default, and can be enabled by adding an annotation to the
migration file:-- +goose ENVSUB ON
-
When enabled, goose will attempt to substitute environment variables in the SQL migration
queries until the end of the file, or until the annotation-- +goose ENVSUB OFF
is found. For
example, if the environment variableREGION
is set tous_east_1
, the following SQL migration
will be substituted toSELECT * FROM regions WHERE name = 'us_east_1';
-- +goose ENVSUB ON -- +goose Up SELECT * FROM regions WHERE name = '${REGION}';
-
This feature intentionally supports a minimal expansion set; see Supported Expansions in the https://github.com/mfridman/interpolate repository (forked from https://github.com/buildkite/interpolate)
-
Fixes
- Fixed query for list migrations in YDB (#684)