Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
girijashankarj avatar

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-migration

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars27
Last updatedApril 25, 2026
Repositorygirijashankarj/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.mdMarkdownGitHub ↗

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

StepFailureRecovery
Step 4DOWN does not revert UP cleanlyFix DOWN to match UP; test both directions; document manual steps if schema change is irreversible
Step 5Review finds unsafe patternsRewrite migration; no raw DELETE; use soft delete; add defaults for new columns

Rules

  • Follow .cursor/rules/database/migration-rules.mdc and schema-design rules.
  • Every table must have id, created_at, updated_at, and soft-delete column per project config.

Related skills

Databasesdatabases

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.