db-migration

db-migration is a skill for Claude Code from justnau1020/claude-os. It costs 31 tokens per session (451 once invoked), scanned A, original, Apache-2.0.

A guide for changing a database’s structure, such as adding a column or creating a table. A migration is a recorded change that updates an existing database while preserving its data.

In plain words
What is it for?
Use it to update application models, generate migrations with Alembic, Prisma, or Django, handle unsupported SQLite changes, and consider locks, table rewrites, and backups.
Why use it?
It helps you create and review the right migration for the project’s database tool and account for differences between SQLite, PostgreSQL, and MySQL.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it to update application models, generate migrations with Alembic, Prisma, or Django, handle unsupported SQLite changes, and consider locks, table rewrites, and backups.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/justnau1020/claude-os/db-migration
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add justnau1020/claude-os --skill db-migration
Clone the repo
git clone --depth 1 https://github.com/justnau1020/claude-os

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for db-migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/justnau1020/claude-os/db-migration/github.svg)](https://agentmods.dev/skills/justnau1020/claude-os/db-migration)
Your own site
<a href="https://agentmods.dev/skills/justnau1020/claude-os/db-migration"><img src="https://agentmods.dev/badge/skills/justnau1020/claude-os/db-migration/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for db-migration

Your own site · 80×15
<a href="https://agentmods.dev/skills/justnau1020/claude-os/db-migration"><img src="https://agentmods.dev/badge/skills/justnau1020/claude-os/db-migration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 451 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00031 $0.00451
Opus 5 $0.00015 $0.00226
Sonnet 5 $0.00006 $0.00090
Haiku 4.5 $0.00003 $0.00045

Measured 10d ago against content hash 440ea2931b43, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

db-migration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/development/db-migration/SKILL.md · 83 lines

What it actually says

Database Migration

Guide a database schema change: $ARGUMENTS

Steps

1. Modify the model

Update the relevant model in the project's model/schema directory. ORM classes (SQLModel, SQLAlchemy, Prisma, etc.) define both the application model and the database schema.

2. Create migration

Generate the migration using the project's migration tool:

# Alembic (Python/SQLAlchemy)
alembic revision --autogenerate -m "$ARGUMENTS"

# Prisma (TypeScript/Node)
npx prisma migrate dev --name "$ARGUMENTS"

# Django
python manage.py makemigrations

Review the generated migration before applying.

3. Database-specific limitations

SQLite has limited ALTER TABLE support:

  • Can ADD COLUMN
  • Cannot DROP COLUMN (before SQLite 3.35)
  • Cannot ALTER COLUMN type
  • For complex changes, may need to recreate the table

PostgreSQL/MySQL support most ALTER TABLE operations but watch for:

  • Lock contention on large tables
  • Default values requiring table rewrites

If the migration requires unsupported operations, create a manual migration that:

  1. Creates a new table with the desired schema
  2. Copies data from the old table
  3. Drops the old table
  4. Renames the new table

4. Backup first

Before running any migration on production data:

# SQLite
cp database.db database.db.backup

# PostgreSQL
pg_dump dbname > backup.sql

5. Apply migration

# Alembic
alembic upgrade head

# Prisma
npx prisma migrate deploy

# Django
python manage.py migrate

6. Test

Write tests to verify:

  • New schema works with existing data
  • Migration is reversible (if supported by the migration tool)
  • Application still functions correctly with the new schema
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 83 lines · 31 tokens per session scan A 440ea2931b43

Subscribe to this mod's changes

db-migration is a skill published in the GitHub repository justnau1020/claude-os (3 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 31 tokens to every session and 451 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

db-migrator

A database change helper that compares the code-defined database structure with its migration history and creates scripts for updating it. A database migration is a controlled change to tables, fields, indexes, or relationships.

laolaoshiren/claude-code-skills-zh · 19 tokens

cnpg

Create and operate CloudNativePG (CNPG) Postgres databases on Kubernetes the GitOps/Flux way - on managed cloud (GKE + GCS via Workload Identity) OR self-hosted (K3s/bare-metal + any S3-compatible store via a credentials secret). Covers Cluster + ScheduledBackup manifests, barman WAL archiving, pgvector, PITR…

vanducng/skills · 155 tokens

miudb

Query, inspect, and manage saved database connections through the Go miudb CLI. Use when the user asks to run SQL, list schemas, add native connections, smoke-test connections, inspect tunnel-backed databases, or produce agent-readable JSON from SQLite, Postgres, MySQL, Snowflake, or BigQuery.

vanducng/skills · 69 tokens

dbdesign

Design and review production database schemas, data models, ERDs, migration plans, and storage patterns. Use for OLTP schema design, OLAP/star-schema modeling, fact/dimension tables, indexes, constraints, partitioning, multi-tenant data models, CSV/JSON-to-table design, schema review, migration risk review, and…

vanducng/skills · 98 tokens

review-board

Review the Vibe Board (Firebase Firestore) for stale tasks, orphans, duplicates, done-but-unmarked work, abandoned projects, session handoff quality, and referential integrity. Creates remediation board tasks for every finding.

HuntsDesk/ve-kit · 49 tokens

db-whisperer

Diagnoses and improves application-layer databases: Postgres, MySQL, SQLite, and MongoDB. Covers EXPLAIN ANALYZE, slow query detection, index strategy, N+1 detection, schema migrations with up/down scripts, connection pooling, replication setup, and vacuum/analyze operations. Use this skill when the user says "this…

mturac/hermes-supercode-skills · 131 tokens