# Plan Reliable Database Migrations

Database changes can cause data loss, downtime, or difficult rollbacks. This skill creates migration plans and ORM examples with validation and recovery steps.

## Install

```bash
npx skillstore add sickn33/database-migration
```

## Metadata

- Status: approved
- Slug: sickn33-database-migration
- Skillstore revision: r2
- Version status: missing
- Tree hash: fd3f71d0a399e25a82f8d6512004138c93fa8d6a4813f481fd91ac6eb65d6182
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/database-migration
- Ref: f9e2c34b4f19c7f3e6b0a1e93227b5f77cc12526
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/sickn33-database-migration
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-database-migration/manifest

## Capabilities

- Creates Sequelize migration examples with apply and rollback operations.
- Drafts TypeORM migrations using MigrationInterface and QueryRunner patterns.
- Models Prisma schema changes and provides migration command guidance.
- Plans staged column renames, type conversions, and data backfills.
- Designs transaction-based and checkpoint-based rollback strategies.
- Addresses PostgreSQL and MySQL data type differences.

## Use Cases

- Add a production schema field: Create an incremental schema change with a backfill, validation checks, and a tested rollback path.
- Coordinate a zero-downtime release: Sequence compatible database and application changes while defining monitoring, cutover, and cleanup checkpoints.
- Review migration readiness: Assess data integrity risks, rollback coverage, database differences, and verification criteria before approval.

## Prompt Templates

### Create a basic schema migration

```
Create a [Sequelize, TypeORM, or Prisma] migration that adds [field] to [table]. Include apply, rollback, validation, and test steps.
```

### Plan a safe data backfill

```
Plan a migration from [source field] to [target fields] for [record count] records. Include batching, NULL handling, verification, and rollback.
```

### Design a zero-downtime change

```
Design a zero-downtime migration to [rename or change] [column] on [table]. Separate database changes, application deployments, backfill, monitoring, and cleanup.
```

### Prepare a cross-database migration

```
Prepare a PostgreSQL-to-MySQL migration for [scope]. Map incompatible types, preserve constraints, define cutover, test rollback, and state assumptions.
```

## Limitations

- It cannot inspect a database or deployment environment without supplied context.
- Its examples require adaptation for ORM versions, database dialects, and local conventions.
- It cannot guarantee zero downtime without workload testing and deployment coordination.
- Referenced auxiliary resources are not included in this package.

## Best Practices

- Test apply and rollback paths against production-like data before deployment.
- Use small, backward-compatible changes with explicit verification checkpoints.
- Back up critical data and monitor errors, locks, latency, and row counts.

## Anti Patterns

- Do not combine unrelated destructive changes in one migration.
- Do not remove old fields before all application versions stop using them.
- Do not treat successful execution as proof of data correctness.

## Security Audit

- Audited at: 2026-07-23T22:36:01.173\+00:00
- Summary: All 28 static findings are false positives caused by Markdown code fences, JavaScript SQL template literals, and ordinary schema identifiers. The skill provides educational database migration examples and contains no command execution, system reconnaissance, prompt injection, or malicious intent.

## Stats

- Views: 157
- Downloads: 8
- Favorites: 0
- Popularity score: 0
