OS Manuals

/usr/bin/goose

Database migration tool supporting SQL migrations and Go functions (FIPS-enabled)

From goose-fips 3.29.0-r5 (enterprise-packages), captured 2026-11-08 by running goose --help (exit 0). permalink

Usage: goose DRIVER DBSTRING [OPTIONS] COMMAND

or

Set environment key
GOOSE_DRIVER=DRIVER
GOOSE_DBSTRING=DBSTRING
GOOSE_MIGRATION_DIR=MIGRATION_DIR

Usage: goose [OPTIONS] COMMAND

Drivers:
    postgres
    mysql
    sqlite3
    spanner
    mssql
    azuresql
    redshift
    tidb
    clickhouse
    ydb
    starrocks
    turso

Examples:
    goose sqlite3 ./foo.db status
    goose sqlite3 ./foo.db create init sql
    goose sqlite3 ./foo.db create add_some_column sql
    goose sqlite3 ./foo.db create fetch_user_data go
    goose sqlite3 ./foo.db up

    goose postgres "user=postgres dbname=postgres sslmode=disable" status
    goose mysql "user:password@/dbname?parseTime=true" status
    goose redshift "postgres://user:password@qwerty.us-east-1.redshift.amazonaws.com:5439/db" status
    goose tidb "user:password@/dbname?parseTime=true" status
    goose mssql "sqlserver://user:password@dbname:1433?database=master" status
    goose azuresql "sqlserver://myserver.database.windows.net?database=mydb&fedauth=ActiveDirectoryDefault" status
    goose clickhouse "tcp://127.0.0.1:9000" status
    goose ydb "grpcs://localhost:2135/local?go_query_mode=scripting&go_fake_tx=scripting&go_query_bind=declare,numeric" status
    goose turso "libsql://dbname.turso.io?authToken=token" status

    GOOSE_DRIVER=sqlite3 GOOSE_DBSTRING=./foo.db goose status
    GOOSE_DRIVER=sqlite3 GOOSE_DBSTRING=./foo.db goose create init sql
    GOOSE_DRIVER=postgres GOOSE_DBSTRING="user=postgres dbname=postgres sslmode=disable" goose status
    GOOSE_DRIVER=mysql GOOSE_DBSTRING="user:password@/dbname" goose status
    GOOSE_DRIVER=redshift GOOSE_DBSTRING="postgres://user:password@qwerty.us-east-1.redshift.amazonaws.com:5439/db" goose status
    GOOSE_DRIVER=turso GOOSE_DBSTRING="libsql://dbname.turso.io?authToken=token" goose status
    GOOSE_DRIVER=clickhouse GOOSE_DBSTRING="clickhouse://user:password@qwerty.clickhouse.cloud:9440/dbname?secure=true&skip_verify=false" goose status

Options:

  -allow-missing
    	applies missing (out-of-order) migrations
  -certfile string
    	file path to root CA's certificates in pem format (only support on mysql)
  -dir string
    	directory with migration files, (GOOSE_MIGRATION_DIR env variable supported) (default ".")
  -env string
    	load environment variables from file (default .env)
  -h	print help
  -no-color
    	disable color output (NO_COLOR env variable supported)
  -no-versioning
    	apply migration commands with no versioning, in file order, from directory pointed to
  -s	use sequential numbering for new migrations
  -ssl-cert string
    	file path to SSL certificates in pem format (only support on mysql)
  -ssl-key string
    	file path to SSL key in pem format (only support on mysql)
  -table string
    	migrations table name
  -timeout duration
    	maximum allowed duration for queries to run; e.g., 1h13m
  -v	enable verbose mode
  -version
    	print version

Commands:
    up                   Migrate the DB to the most recent version available
    up-by-one            Migrate the DB up by 1
    up-to VERSION        Migrate the DB to a specific VERSION
    down                 Roll back the version by 1
    down-to VERSION      Roll back to a specific VERSION
    redo                 Re-run the latest migration
    reset                Roll back all migrations
    status               Dump the migration status for the current DB
    version              Print the current version of the database
    create NAME [sql|go] Creates new migration file with the current timestamp
    env                  Print the current Goose environment configuration
    fix                  Apply sequential ordering to migrations
    validate             Check migration files without running them
Options (14)
OptionDescriptionSource
-allow-missingapplies missing (out-of-order) migrationshelp
-certfile stringfile path to root CA's certificates in pem format (only support on mysql)help
-dir stringdirectory with migration files, (GOOSE_MIGRATION_DIR env variable supported) (default ".")help
-env stringload environment variables from file (default .env)help
-hprint helphelp
-no-colordisable color output (NO_COLOR env variable supported)help
-no-versioningapply migration commands with no versioning, in file order, from directory pointed tohelp
-suse sequential numbering for new migrationshelp
-ssl-cert stringfile path to SSL certificates in pem format (only support on mysql)help
-ssl-key stringfile path to SSL key in pem format (only support on mysql)help
-table stringmigrations table namehelp
-timeout durationmaximum allowed duration for queries to run;help
-venable verbose modehelp
-versionprint versionhelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.