Verify one migration
verify_migrationVerify a Postgres migration was actually applied by comparing every object it should create, alter or drop against the live catalog, independent of the history table. Read-only; reports MATCH or MISMATCH.
Instructions
Check whether one migration was really applied by comparing every object it should create, alter or drop with the live Postgres catalog, independently of the history table. Use it after applying a migration (e.g. by pasting it into the Supabase SQL editor) or whenever it is unclear whether a migration ran. Reports MATCH n/n or MISMATCH n/n with every problem object and the line it comes from, and whether the version is recorded in supabase_migrations.schema_migrations. Meaning of the output: MATCH = every object the migration should leave behind exists as written. MISMATCH = at least one object is MISSING (not found), DIFFERENT (found with other attributes, e.g. type or nullability) or UNEXPECTED (dropped or renamed by the migration but still there). MATCH* = a MATCH that does not show the file ran (every check would also hold without it), so "NOT recorded" there does not mean applied by hand. NOTHING TO VERIFY = no statement yields a catalog check. SUPERSEDED = a later migration drops or rebuilds the object or what it depends on (or IF NOT EXISTS skipped the statement), so it cannot be checked against this file; objects renamed later are checked under their new name. UNVERIFIABLE = a statement that cannot be checked against the catalog (DO blocks, GRANTs, data changes); review it by hand. 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
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file": "<file>"
},
"name": "verify_migration"
}
}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). | |
| file | Yes | The migration: its file name (20240101120000_create_profiles.sql), a path ending in it, its version (20240101120000) or its name (create_profiles). Only exact matches count. | |
| verbose | No | Also list objects that match and statements that were ignored. Default false: only problems, superseded objects and unverifiable statements are listed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | Yes | ||
| checks | Yes | Every check of this migration, matching ones included | |
| history | Yes | Whether the recorded migration history could be read | |
| migration | Yes |