Database Schema Diff Skill for PostgreSQL in Claude Code
Compare two PostgreSQL definitions and produce a reviewable list of changed column defaults, constraints, and indexes.
中文Install in Claude Code
Use schema-only dumps from two test databases or two trusted DDL files. Use the same PostgreSQL client version for both exports.
- Get the complete `plugins/database/database-diff-tool/skills/comparing-database-schemas` directory from the pinned GitHub commit.
- Copy it into the target project's `.claude/skills/`. Check `.claude/skills/comparing-database-schemas/SKILL.md`, start Claude Code at the project root, and call `/comparing-database-schemas`.
Example task
Set orders.status to default to 'pending' in the baseline, and add orders_created_at_idx there. In the other test database use 'draft' with no index. Dump both using pg_dump --schema-only --no-owner --no-privileges and compare.What to check
The report identifies the missing orders_created_at_idx and the different default for orders.status. Both findings point to the relevant DDL.
Original SKILL.md on GitHub · Updated
Frequently asked question
Can I immediately migrate when an index is missing?
Check migration history and validate the change on a disposable copy before scheduling a production migration.