Skip to content
Back to skills

Migration

ASecurity

Create reversible database migrations with rollback scripts.

  • 27 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added February 7, 2026
databasessqldatabaseperformance

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add vneseyoungster/ChocoVine --skill migration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Migration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Migration
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vneseyoungster-migration/badge)](https://www.skillsdirectory.com/skills/vneseyoungster-migration)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: migration
description: Create reversible database migrations with rollback scripts.
  Use when modifying database schemas.
---

# Migration Skill

## Purpose
Create safe, reversible database migrations.

## Migration Template
Use: [templates/migration-template.sql](templates/migration-template.sql)

```sql
-- Migration: [description]
-- Created: [date]
-- Author: [name]

-- ==================== UP ====================
BEGIN;

-- Your migration here
CREATE TABLE users (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  email VARCHAR(255) NOT NULL UNIQUE,
  created_at TIMESTAMP DEFAULT NOW()
);

COMMIT;

-- ==================== DOWN ====================
BEGIN;

DROP TABLE IF EXISTS users;

COMMIT;
```

## Pre-Migration Checklist
Use: [checklists/pre-migration.md](checklists/pre-migration.md)

- [ ] Down migration works
- [ ] Tested on production-like data
- [ ] Performance impact assessed
- [ ] Backup plan documented
- [ ] Deployment timing considered

## Migration Types

### Safe Migrations
- Add table
- Add nullable column
- Add index (CONCURRENTLY)
- Add foreign key (without validation)

### Risky Migrations
- Drop table (verify no references)
- Drop column (verify no usage)
- Rename column (may break app)
- Change column type (may lose data)

### Dangerous Migrations
- Truncate table
- Drop database
- Remove constraints

## Large Table Migrations
For tables with >1M rows:
1. Create new structure
2. Backfill in batches
3. Add constraints
4. Switch over
5. Clean up old structure

## Rollback Strategy
- Test down migration before running up
- Document manual rollback steps
- Have production backup
- Consider feature flags for code changes

Files in this skill

  • SKILL.md1.6 KB
  • checklists/pre-migration.md4.1 KB
  • templates/migration-template.sql5.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…