
Create Migration
- 1 installs
- 27 repo stars
- Updated April 25, 2026
- girijashankarj/cursor-handbook
Creates a database migration following project naming and safety rules, writing backward-compatible UP and reversible DOWN migrations.
About
Guides creating a database migration with timestamped naming, backward-compatible UP, tested DOWN rollback, and safety review. A developer uses it to add a migration for a schema change.
- Writes reversible UP/DOWN with CREATE INDEX CONCURRENTLY and default-safe columns
- Review step bans raw DELETE, requires soft delete, and adds FK/filter indexes
Create Migration by the numbers
- 1 all-time installs (skills.sh)
- Ranked #770 of 911 Databases skills by installs in the Skillselion catalog
- Data as of Jul 22, 2026 (Skillselion catalog sync)
npx skills add https://github.com/girijashankarj/cursor-handbook --skill create-migrationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 27 |
| Last updated | April 25, 2026 |
| Repository | girijashankarj/cursor-handbook ↗ |
What it does
Creates a database migration following project naming and safety rules, writing backward-compatible UP and reversible DOWN migrations.
Files
Skill: Create migration
Trigger
When the user asks to add a migration, create a migration for a schema change, or "migrate the DB."
Steps
1. Clarify — Confirm the change (new table, new column, index, constraint); ensure backward compatible where possible. 2. Naming — Use format YYYYMMDDHHMMSS_descriptive_action.sql (or project equivalent). 3. UP — Write the forward migration (ADD COLUMN with default, CREATE INDEX CONCURRENTLY where supported). 4. DOWN — Write the rollback; test that DOWN reverts UP cleanly. 5. Review — No raw DELETE; use soft delete if needed; parameterized only; add index for new FK/filters.
If a step fails
| Step | Failure | Recovery |
|---|---|---|
| Step 4 | DOWN does not revert UP cleanly | Fix DOWN to match UP; test both directions; document manual steps if schema change is irreversible |
| Step 5 | Review finds unsafe patterns | Rewrite migration; no raw DELETE; use soft delete; add defaults for new columns |
Rules
- Follow
.cursor/rules/database/migration-rules.mdcand schema-design rules. - Every table must have id, created_at, updated_at, and soft-delete column per project config.