
db-migration-reviewer
Review Drizzle ORM migrations for MySQL. Checks for potential data loss, performance issues, missing
作者 gregsuptown|オープンソース
Database Migration Reviewer (MySQL/Drizzle)
Standards
Schema Design
- ✅ Use appropriate column types (e.g.,
varchar(255)for emails,textfor long content) - ✅ Ensure primary keys are defined for every table
- ✅ Use
timestampfor created/updated fields with appropriate defaults - ✅ Define foreign key constraints for relationships
Performance
- ✅ Ensure columns used in WHERE clauses are indexed
- ✅ Avoid over-indexing (limit to essential query patterns)
- ✅ Check for full table scans in proposed query changes
Safety
- ❌ No
DROP TABLEorDROP COLUMNwithout explicit confirmation - ❌ No renaming columns without a multi-step migration strategy (if in production)
- ✅ Ensure default values are set for new NOT NULL columns
Drizzle Specifics
- ✅ Ensure
drizzle-kit generatewas run after schema changes - ✅ Check that migrations are sequential and don't conflict
Review Checklist
- Data Loss: Does this migration delete or modify existing data?
- Indexing: Are the new tables/columns properly indexed for their intended use?
- Naming: Do table and column names follow the project's camelCase or snake_case convention?
- Types: Are the column types optimal for the data they will store?
Auto-Invocation Triggers
This Skill should activate when:
- Reviewing files in
drizzle/folder - Reviewing
server/db/schema.tsor similar schema files - User asks to "check database changes" or "review migration"