migration

migration is a skill for Cursor from girijashankarj/cursor-handbook. It costs 23 tokens per session (550 once invoked), scanned A, original, MIT.

A safe workflow for changing a database's structure, such as adding tables, columns, indexes, or constraints. A migration is a recorded change that can be applied to a database and, where possible, rolled back.

In plain words
What is it for?
Use it to plan schema changes, write forward and rollback SQL, move existing data in batches, and test changes against realistic data.
Why use it?
It reduces the risk of lost data, broken older code, and changes that cannot be undone. It also checks compatibility, data movement, and integrity before production use.

Skill for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to plan schema changes, write forward and rollback SQL, move existing data in batches, and test changes against realistic data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/girijashankarj/cursor-handbook/migration
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add girijashankarj/cursor-handbook --skill migration
Clone the repo
git clone --depth 1 https://github.com/girijashankarj/cursor-handbook

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/girijashankarj/cursor-handbook/migration/github.svg)](https://agentmods.dev/skills/girijashankarj/cursor-handbook/migration)
Your own site
<a href="https://agentmods.dev/skills/girijashankarj/cursor-handbook/migration"><img src="https://agentmods.dev/badge/skills/girijashankarj/cursor-handbook/migration/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for migration

Your own site · 80×15
<a href="https://agentmods.dev/skills/girijashankarj/cursor-handbook/migration"><img src="https://agentmods.dev/badge/skills/girijashankarj/cursor-handbook/migration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 550 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.00550
Opus 5 $0.00012 $0.00275
Sonnet 5 $0.00005 $0.00110
Haiku 4.5 $0.00002 $0.00055

Measured 5d ago against content hash f6417ccc501c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

migration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/skills/database/migration/SKILL.md · 65 lines

How it starts

The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: Create Database Migration

Trigger

When the user needs to modify the database schema.

Steps

Step 1: Plan the Change

  • Define what's changing and why
  • Check for backward compatibility
  • Identify affected queries and code
  • Determine if data migration is needed

Step 2: Create Migration File

  • Name: YYYYMMDDHHMMSS_descriptive_name.sql
  • Write UP migration (apply change)
  • Write DOWN migration (rollback)
  • Include required columns: {{CONFIG.database.timestampFields.created}}, {{CONFIG.database.timestampFields.updated}}, {{CONFIG.database.softDeleteField}}

Step 3: Safety Checks

  • No DELETE FROM statements (soft delete only)
  • New columns have defaults or are nullable
  • Indexes created with CONCURRENTLY for large tables
  • No column renames (add new → migrate → drop old)
  • Foreign keys have appropriate cascade rules

Step 4: Data Migration

If needed:

  • Write data migration script
  • Use batch processing (1000-5000 rows per batch)
  • Make it idempotent (safe to re-run)
  • Include progress logging

Step 5: Test Migration

  • Apply to development database
  • Verify data integrity
  • Test rollback
  • Test with production-like data volume
  • Verify affected queries still work

Step 6: Update Code

  • Update models/types to match new schema
  • Update affected queries
  • Run type check: {{CONFIG.testing.typeCheckCommand}}
  • Run affected tests

If a step fails

Step Failure Recovery
Step 2 Syntax error in migration Fix SQL; re-run
Step 4 Data migration fails mid-run Script should be idempotent; fix and re-run; if partial data, document manual cleanup
Step 5 Test migration fails Run DOWN migration to revert; fix UP migration; retest
Step 5 Rollback test fails Fix DOWN migration; ensure DOWN fully reverts UP before retrying

Never apply migrations to production without testing UP and DOWN in a non-prod environment first.

Read the full file on GitHub · 65 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 65 lines · 23 tokens per session scan A f6417ccc501c

Subscribe to this mod's changes

migration is a skill published in the GitHub repository girijashankarj/cursor-handbook (30 stars, last pushed 8d ago), licensed MIT. It adds 23 tokens to every session and 550 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

firebase-cloud-firestore

Use when setting up Firestore, designing schemas, doing CRUD, creating listeners, paginating queries, configuring indexes, enabling offline persistence, or writing security rules.

evanca/flutter-ai-rules · 37 tokens

firebase-database

Use when syncing real-time data, structuring JSON trees, reading/writing, creating listeners, enabling offline persistence, managing presence, sharding, or writing security rules.

evanca/flutter-ai-rules · 38 tokens

firebase-data-connect

Use when setting up Data Connect, writing GraphQL queries/mutations, configuring generated SDKs, handling offline, or applying security rules.

evanca/flutter-ai-rules · 31 tokens

audit-db-schema

Audit database schema for consistency, validation, and industry standards. Use when reviewing schema design, naming conventions, constraints, indexes, or migrations. Destructive-op gates → plan-data-integrity. Who-can-read-what RLS → plan-rls-audit. Restore/RPO → plan-backup-dr.

kensaurus/cursor-kenji · 66 tokens

backend-db-performance

Optimize slow queries, indexes, and N+1s. Use when "slow query", "database performance", "add an index", or "N+1". Schema consistency → audit-db-schema. RLS access control → plan-rls-audit.

kensaurus/cursor-kenji · 56 tokens

plan-rls-audit

Audit a Supabase/Postgres project for Row-Level Security and access-control gaps, then produce a phased remediation plan. Use when "RLS", "is my Supabase secure", "anyone can read my data", "lock down my tables". App-layer session/route gates → audit-auth-flows.

kensaurus/cursor-kenji · 69 tokens