goose status: Applied and Pending Migrations
goose <driver> <dsn> status prints each migration with the time it was applied, or Pending if it has not run.
status is the read-only view of goose. It shows the full list so you can see what a subsequent up would apply.
What it does
goose status joins the migrations directory against goose_db_version and prints one line per migration with either the applied timestamp or "Pending". It makes no changes.
Common usage
goose -dir ./migrations postgres "$GOOSE_DSN" status
# also useful: print the current version
goose -dir ./migrations postgres "$GOOSE_DSN" versionOptions
| Arg / flag | What it does |
|---|---|
| status | List applied/pending state for each migration |
| version | Print the current database version |
| -dir <dir> | Migrations directory |
| <driver> <dsn> | Driver and connection string |
In CI
Run status in a pre-deploy job to confirm the migration set matches expectations, or version to assert a specific number. Both are read-only. If goose_db_version does not exist yet, status shows every migration as Pending, which is the expected state for a fresh database.
Common errors in CI
"no migration files found in ..." means -dir does not point at the migrations in the CI checkout. Connection errors ("failed to open db") mean the DSN or network is wrong. If status shows a migration as applied but the table it created is missing, a prior migration was only partly applied; reconcile before running up.