Skip to content
Back to skills

Db Migration Generator

ASecurity

Generate database schema migration scripts (Prisma/TypeORM/Alembic) based on model changes.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 27, 2026
developmentpythonbashsqlnodedatabase

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add RMAzrim/opencode-artes --skill db-migration-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Db Migration Generator?

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

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

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: DB Migration Generator
description: Generate database schema migration scripts (Prisma/TypeORM/Alembic) based on model changes.
metadata:
  source: skills/db-migration-generator/db-migration-generator.md
---

# DB Migration Generator

## Prerequisites & Dependencies
- Node.js 18+ with `prisma` or `typeorm`, or Python 3.10+ with `alembic`, matching the project ORM
- Existing ORM setup: `schema.prisma`, TypeORM `DataSource` config, or `alembic.ini` plus `env.py`
- `DATABASE_URL` pointing to a dev database that mirrors the current production schema

## Execution Steps
1. Sync the dev database to the last applied migration so the diff is computed against the true current state.
2. Apply model changes (edit `schema.prisma`, TypeORM entities, or SQLAlchemy models).
3. Auto-generate a descriptively named migration using the ORM diff engine (e.g., `add_user_email_index`).
4. Read the generated SQL before applying: flag destructive operations (column drops, type changes, table locks on large tables) for manual review.
5. Apply the migration to the dev database and verify the resulting schema (`prisma db pull`, `alembic current`, or information_schema inspection).
6. Test the rollback path (`alembic downgrade -1`, TypeORM `migration:revert`) and document any irreversible steps for ops sign-off.

```bash
# Prisma
npx prisma migrate dev --name add_user_email_index
npx prisma migrate status

# TypeORM
npx typeorm migration:generate -d src/data-source.ts src/migrations/AddUserEmailIndex
npx typeorm migration:run -d src/data-source.ts

# Alembic
alembic revision --autogenerate -m "add user email index"
alembic upgrade head
alembic downgrade -1
```

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.