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.5 $0.00012 $0.00180
Sonnet 5.5 $0.00006 $0.00090
Haiku 4.5 $0.00003 $0.00045

Measured 1mo ago against content hash 440ea2931b43, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 6mo ago), licensed Apache-2.0. It adds 31 tokens to every session and 451 once invoked, about $0.0001 per session on Opus 5.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

tiledbvcf

Stores and retrieves genomic variant calls with TileDB-VCF. Use for indexed single-sample VCF/BCF ingestion, incremental cohorts, region and sample queries, streaming results, allele statistics, QC, and VCF/BCF export locally or through TileDB Cloud.

K-Dense-AI/scientific-agent-skills · 62 tokens

database-optimizer

Optimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.

Jeffallan/claude-skills · 54 tokens

timescaledb-hyperfunctions

Use this skill when writing analytical SQL over time-series data with the TimescaleDB Toolkit (timescaledbtoolkit extension) hyperfunctions: approximate percentiles, statistical summaries, time-weighted averages, counter/gauge rates, uptime/heartbeat tracking, state durations, OHLC candlesticks, approximate distinct…

timescale/pg-aiguide · 298 tokens

pgvector-semantic-search

Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. Trigger when user asks to: Store or search vector embeddings in PostgreSQL Set up semantic search, similarity search, or nearest neighbor search Create HNSW or IVFFlat indexes for vectors…

timescale/pg-aiguide · 190 tokens

find-hypertable-candidates

Use this skill to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables. Trigger when user asks to: Analyze database tables for hypertable conversion potential Identify time-series or event tables in an existing schema Evaluate if a table would…

timescale/pg-aiguide · 184 tokens

postgres-hybrid-text-search

Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). Trigger when user asks to: Combine keyword and semantic search Implement hybrid search or multi-modal retrieval Use BM25/pgtextsearch with pgvector together Implement RRF (Reciprocal…

timescale/pg-aiguide · 162 tokens