database-migrations

database-migrations is a skill for Claude Code from tozhax/plumbwork. It costs 88 tokens per session (1,522 once invoked), scanned B, original, MIT.

A method for changing database tables, columns, indexes, or constraints safely while an application is running. It includes rollback plans, compatibility steps, and zero-downtime techniques that avoid blocking active requests.

In plain words
What is it for?
Use it to create schema and data migrations for PostgreSQL, MySQL, or database frameworks, including backfills, production deployments, and rollbacks.
Why use it?
It reduces outages, failed deployments, long database locks, and migrations that cannot be safely reversed.

Skill for Claude Code

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

Good fit Use it to create schema and data migrations for PostgreSQL, MySQL, or database frameworks, including backfills, production deployments, and rollbacks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tozhax/plumbwork/database-migrations
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 tozhax/plumbwork --skill database-migrations
Clone the repo
git clone --depth 1 https://github.com/tozhax/plumbwork

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 database-migrations

README.md
[![agentmods](https://agentmods.dev/badge/skills/tozhax/plumbwork/database-migrations/github.svg)](https://agentmods.dev/skills/tozhax/plumbwork/database-migrations)
Your own site
<a href="https://agentmods.dev/skills/tozhax/plumbwork/database-migrations"><img src="https://agentmods.dev/badge/skills/tozhax/plumbwork/database-migrations/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 database-migrations

Your own site · 80×15
<a href="https://agentmods.dev/skills/tozhax/plumbwork/database-migrations"><img src="https://agentmods.dev/badge/skills/tozhax/plumbwork/database-migrations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,522 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00088 $0.01522
Opus 5.5 $0.00035 $0.00609
Sonnet 5.5 $0.00018 $0.00304
Haiku 4.5 $0.00009 $0.00152

Measured 2d ago against content hash 79007da4ba8a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

database-migrations scanned grade B with 1 finding 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 2d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- Before delivering any migration that alters or drops persisted columns/tables, dispatch `contract-change-auditor` (`~/.gemini/config/agents/contract-change-auditor.md`) to verify expand-and-contract compatibility and r
skills/database-migrations/SKILL.md · 123 lines

How it starts

The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database Migration Patterns & Zero-Downtime Playbook

This skill enforces safe schema evolutions, rollback strategies, and zero-downtime migrations.

When to Activate

  • Creating or modifying database tables, columns, indexes, or constraints
  • Writing data backfill migrations
  • Planning database deployments under active production traffic
  • Designing rollbacks for failed or reverted deployments
  • Before delivering any migration that alters or drops persisted columns/tables, dispatch contract-change-auditor (~/.gemini/config/agents/contract-change-auditor.md) to verify expand-and-contract compatibility and rollback safety.

Core Principles

  1. Backward Compatibility: Every migration must be deployable before the new application code without breaking existing running instances.
  2. Non-Blocking Execution: Avoid long-held table locks (ACCESS EXCLUSIVE) that cause request queues and outages.
  3. Reversible by Design: Every schema change must have an explicit down/rollback strategy or documented forward-fix procedure.
  4. Idempotency: Migrations must succeed cleanly if retried or re-executed where supported (IF EXISTS, IF NOT EXISTS).

PostgreSQL Zero-Downtime Patterns

1. Adding Columns Safely

-- PostgreSQL 11+: nullable or non-volatile default avoids a table rewrite,
-- but STILL takes an ACCESS EXCLUSIVE lock held until transaction end.
SET LOCAL lock_timeout = '2s';
ALTER TABLE users ADD COLUMN bio TEXT DEFAULT '' NOT NULL;

-- CAUTION (all PG versions, including PG 11+): volatile defaults (e.g. random(), clock_timestamp())
-- still rewrite the entire table. Adding NOT NULL without a default on a populated table fails
-- immediately with not_null_violation (SQLSTATE 23502) rather than backfilling rows.
-- Pattern: Add nullable column -> backfill -> add NOT NULL constraint (via NOT VALID + VALIDATE CONSTRAINT).

2. Creating Indexes Without Downtime

-- ALWAYS use CONCURRENTLY on production tables to prevent write-blocking locks:
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_users_email ON users (email);

-- NOTE: CONCURRENTLY cannot execute inside a transaction block.
-- Ensure ORM / migration runner executes this outside the default transaction.

Read the full file on GitHub · 123 lines

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. 2d ago First seen · 123 lines · 88 tokens per session scan B 79007da4ba8a

Subscribe to this mod's changes

database-migrations is a skill published in the GitHub repository tozhax/plumbwork (33 stars, last pushed 2d ago), licensed MIT. It adds 88 tokens to every session and 1,522 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-12-02.

Related

database-migrations compared with skills from other repositories

database-migrations next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
database-migrationstozhax/plumbworkSkill332d agoMITB88Claude Code
alloydb-basicsgoogle/skillsSkill26kyesterdayApache-2.0A72Claude Code, Codex
postgresql-table-designwshobson/agentsSkill43k2d agoMITA37Claude Code
db-repairgarrytan/gbrainSkill34ktodayMITA96Claude Code
dsqlawslabs/agent-pluginsSkill958yesterdayApache-2.0A247Claude Code
volcengine-rds-postgresqlbytedance/agentkit-samplesSkill496todayApache-2.0A63Claude Code, Codex
postgresdbericrisco/rsc-harnessSkill7072d agoMITA91Claude Code, Codex