detecting-schema-driftlisted
Install: claude install-skill musher-dev/bundles
# Schema Drift Detection
Framework for detecting, investigating, and reconciling divergence between production database schemas and version-controlled schema definitions.
## Purpose
Schema drift occurs when the production database catalog diverges from the schema defined in version control. This happens through emergency hotfixes applied directly to production, manual DBA interventions, dynamic partition creation, or failed migration rollbacks. Undetected drift undermines the guarantee that VCS is the source of truth — migrations may fail silently, CI checks become meaningless, and disaster recovery from VCS produces a different schema than production.
Use this skill when setting up drift detection infrastructure, investigating a drift alert, reconciling an out-of-band production change, or designing partition exclusion rules for dynamic schemas.
---
## Drift Sources
### Common Causes
| Source | Frequency | Risk Level | Example |
|--------|-----------|------------|---------|
| Emergency hotfix | Occasional | High | DBA adds index directly to fix timeout spike |
| Failed migration rollback | Rare | Critical | Partial migration leaves schema in intermediate state |
| Dynamic partitions | Regular | Low (if excluded) | Cron job creates monthly partitions not in VCS |
| Manual DBA intervention | Occasional | High | Column type changed to fix data issue |
| ORM auto-migration | Depends on setup | Medium | ORM applies changes not captured in Atlas migrations |
| Extension up