Skip to content
Back to skills

Db Migrations

ASecurity

Safe database schema changes with Prisma or Drizzle. Use when adding or changing tables, columns, indexes or relations, or writing a data migration.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsdatabase

Works with

  • cli

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add kinleyrabgay/coxswain --skill db-migrations --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Db Migrations?

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

Security grade badge for Db Migrations
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kinleyrabgay-db-migrations/badge)](https://www.skillsdirectory.com/skills/kinleyrabgay-db-migrations)

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-migrations
description: Safe database schema changes with Prisma or Drizzle. Use when adding or changing tables, columns, indexes or relations, or writing a data migration.
---
# Database migrations

## Find out what the project uses
- Prisma: `prisma/schema.prisma`, migrations in `prisma/migrations/`. Drizzle: `drizzle.config.*`, schema in `db/schema*` or similar, migrations in `drizzle/`.
- Read the scripts in package.json (`db:migrate`, `db:generate`, …) and use them.

## Rules
- Change the schema, then **generate** a new migration. Never edit a migration that may already be applied anywhere.
- Run migrations only against the local/dev database. Never point a command at staging or production.
- Make changes backward compatible so old code keeps working during deploy:
  - Add columns as nullable or with a default; backfill; then make them required in a later migration.
  - Rename = add new, copy, switch code, drop old later. Never rename in place.
  - Drop columns only after no code reads them.
- Large tables: add indexes concurrently where supported; avoid long locks.
- Data migrations are separate, idempotent and re-runnable.

## In the task log, record
- The migration name, what it changes, whether it locks or rewrites a table, and how to roll back.

## Verify
- Migrate a fresh local database from scratch and from the previous state.
- Regenerate the client/types and run typecheck and the tests that touch the changed models.

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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