OS Manuals

/usr/bin/migrate

Database migrations via golang-migrate, built with the FIPS Go toolchain. Drivers: postgres, pgx5, mysql, redshift, cockroachdb, rqlite, clickhouse, cassandra, neo4j.

From migrate-fips 4.20.1-r5 (enterprise-packages), captured 2026-11-09 by running migrate --help (exit 0). permalink

Usage: migrate OPTIONS COMMAND [arg...]
       migrate [ -version | -help ]

Options:
  -source          Location of the migrations (driver://url)
  -path            Shorthand for -source=file://path
  -database        Run migrations against this database (driver://url)
  -prefetch N      Number of migrations to load in advance before executing (default 10)
  -lock-timeout N  Allow N seconds to acquire database lock (default 15)
  -verbose         Print verbose logging
  -version         Print version
  -help            Print usage

Commands:
  create [-ext E] [-dir D] [-seq] [-digits N] [-format] [-tz] NAME
	   Create a set of timestamped up/down migrations titled NAME, in directory D with extension E.
	   Use -seq option to generate sequential up/down migrations with N digits.
	   Use -format option to specify a Go time format string. Note: migrations with the same time cause "duplicate migration version" error.
           Use -tz option to specify the timezone that will be used when generating non-sequential migrations (defaults: UTC).

  goto V       Migrate to version V
  up [N]       Apply all or N up migrations
  down [N] [-all]    Apply all or N down migrations
	Use -all to apply all down migrations
  drop [-f]    Drop everything inside database
	Use -f to bypass confirmation
  force V      Set version V but don't run migration (ignores dirty state)
  version      Print current migration version

Source drivers: file
Database drivers: cockroachdb, neo4j, rqlite, clickhouse, pgx5, cockroach, crdb-postgres, postgres, postgresql, redshift, stub, cassandra, mysql
Options (8)
OptionDescriptionSource
-sourceLocation of the migrations (driver://url)help
-pathShorthand for -source=file://pathhelp
-databaseRun migrations against this database (driver://url)help
-prefetch NNumber of migrations to load in advance before executing (default 10)help
-lock-timeout NAllow N seconds to acquire database lock (default 15)help
-verbosePrint verbose logginghelp
-versionPrint versionhelp
-helpPrint usagehelp

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