Compare files with recorded history
diff_historyCompare repository migration files against the recorded migration history by version to identify pending, deleted, renamed, or mismatched entries; read-only bookkeeping check.
Instructions
Compare the repository migration files with the recorded history table by version: only in repo (not recorded: pending, or applied by hand without recording), only in database (recorded, but no file has that version: deleted, renamed or from another branch) and in both (a different name is flagged). Compares bookkeeping only, not database objects: follow up with verify_migration for versions only in the repo. Read-only: it reads migration files and pg_catalog inside a READ ONLY transaction, and never runs migration SQL or writes anything. Needs a database URL (PGMV_DATABASE_URL or DATABASE_URL); without one it returns an error saying how to configure it.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "diff_history"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | No | Migrations directory. Relative paths are resolved against the project directory. It must be inside the project directory or the configured migrations directory. Omit to use the configured directory (PGMV_MIGRATIONS_DIR, default supabase/migrations). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diff | Yes | null when the history table is missing or cannot be read | |
| history | Yes | Whether the recorded migration history could be read | |
| directory | Yes | Migrations directory, relative to the project directory when it is inside it |