What problem does it solve?
Applying unchecked database migrations can break production schemas through dangling foreign keys, missing rollback SQL, or destructive operations without safeguards. This Skill audits every pending migration before it runs, catching errors early.
Core Features & Use Cases
- Pending Migration Detection: Cross-references migration files on disk with applied history stored in memory namespaces to identify what has not yet run.
- SQL Safety Checks: Parses .up.sql and .down.sql files to verify foreign key targets exist, NOT NULL columns have defaults, and every CREATE/ALTER has a matching rollback statement.
- Convention & Risk Reporting: Flags destructive operations (DROP TABLE, TRUNCATE), missing IF EXISTS guards, and naming violations, then reports errors, warnings, and suggestions with file paths and line numbers.
- Use Case: Before deploying a release, run the validation to confirm that a new migration adding a NOT NULL column includes a DEFAULT value and that its DOWN file fully reverses the UP changes.
Quick Start
Validate all pending database migrations in this project and report any foreign key, rollback, or naming issues before I apply them.