# Create Safe Backend Migrations

Database schema changes can break deployments when migrations lack rollback plans or compatibility checks. This skill guides Claude, Codex, and Claude Code toward focused migrations.

## Install

```bash
npx skillstore add devanb/backend-migrations
```

## Metadata

- Status: approved
- Slug: devanb-backend-migrations
- Skillstore revision: r1
- Version status: missing
- Tree hash: 1df0fbdb2995ab6841fc90c636033546e85b90a20dca3866ddd8fd34b296e9f5
- Author: DevanB
- GitHub username: DevanB
- License: MIT
- Repository: https://github.com/DevanB/lucidlog/tree/master/.claude/skills/backend-migrations
- Ref: 0519034dad657fb1f7706e0550e962beeda73fdf
- 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, filesystem
- Quality score: 79
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/devanb-backend-migrations
- Manifest: https://skillstore.pages.dev/api/skills/devanb-backend-migrations/manifest

## Capabilities

- Guides creation of new migration files under database/migrations/.
- Prompts careful editing of existing migrations that may already be deployed.
- Covers table, column, index, constraint, and foreign key changes.
- Emphasizes rollback methods for reversible database changes.
- Supports planning for zero-downtime and backwards-compatible deployments.
- Encourages separating schema migrations from data migrations.

## Use Cases

- Plan a New Schema Change: Create a focused migration with clear naming, reversible steps, and deployment considerations.
- Review a Risky Migration: Check an existing migration for rollback gaps, large-table index risks, and backwards compatibility concerns.
- Separate Data and Schema Work: Design safer release steps when schema changes and record updates should not run together.

## Prompt Templates

### Create a Basic Migration

```
Create a reversible backend migration for this schema change: [describe the table, columns, and constraints].
```

### Add an Index Safely

```
Plan a migration to add this index on a large table: [table and columns]. Include deployment risks and rollback steps.
```

### Review an Existing Migration

```
Review this migration plan for reversibility, naming, backwards compatibility, and zero-downtime concerns: [paste summary].
```

### Design a Multi-Step Release

```
Design a safe migration sequence for this feature: [describe schema change, data migration, and application rollout].
```

## Limitations

- The skill provides guidance only; it does not execute migrations.
- It references external migration standards that are outside the packaged skill file.
- It does not inspect live database state or production traffic.
- It does not replace framework-specific migration documentation.

## Best Practices

- Keep each migration focused on one logical schema change.
- Write a rollback path before treating the migration as complete.
- Plan large-table indexes and incompatible changes as staged deployments.

## Anti Patterns

- Do not mix broad schema refactors with unrelated data updates.
- Do not edit deployed migrations without understanding downstream environments.
- Do not assume a column rename is safe for running application code.

## Security Audit

- Audited at: 2026-07-09T12:36:50.266\+00:00
- Summary: The inline backticks on SKILL.md line 12 are markdown formatting, not shell execution. The parent-directory documentation link on line 28 is a confirmed concern because it points outside the packaged skill content.

## Stats

- Views: 198
- Downloads: 9
- Favorites: 0
- Popularity score: 0
