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
| Parameter | Required | Description | Default |
|---|---|---|---|
--remote-only | No | Query applied migrations on the remote side without scanning the local directory | false |
--limit <n> | No | Page size, range [1, 500], --remote-only mode only | 100 |
--offset <n> | No | Page offset, --remote-only mode only | 0 |
-e, --env-id <envId> | Yes | Environment ID | — |
--json | No | Output 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/--offsetfails - Only
--remote-onlymode supports paging