Skip to main content

tcb db pg migration list

List migration status. By default the command compares the local directory with the applied records on the remote side.

Usage​

# Default: local vs remote comparison
tcb db pg migration list -e <envId>

# Remote only, paging optional
tcb db pg migration list -e <envId> --remote-only [--limit <n>] [--offset <n>]

Parameters​

ParameterRequiredDescriptionDefault
--remote-onlyNoQuery applied migrations on the remote side without scanning the local directoryfalse
--limit <n>NoPage size, range [1, 500], --remote-only mode only100
--offset <n>NoPage offset, --remote-only mode only0
-e, --env-id <envId>YesEnvironment ID—
--jsonNoOutput JSON—

Examples​

# Compare local and remote
tcb db pg migration list -e <envId>

# JSON output for scripts
tcb db pg migration list -e <envId> --json

# Latest 200 applied migrations on the remote side only
tcb db pg migration list -e <envId> --remote-only --limit 200 --offset 0

The output has three columns: Local, Remote, and Time (UTC). A record present on one side only leaves the other column empty, which makes unsynchronized items easy to spot.

Notes​

  • The default mode fetches all remote migrations and compares them with the local ones; passing --limit / --offset fails
  • Only --remote-only mode supports paging