Skip to content
Development
Skill

/database-migration

Use before changing any persisted schema — by backend-developer on a server store, by web-developer on a client or server store, and by reliability-engineer when reviewing a change that migrates data. Triggers on the first column, field, index or model change, not on the deploy.

From plugin
app-dev-team
532 skills30 agents27 commands2 hooks

Claude Code

$ npx -y skills add vmobifystudio/app-dev-team --skill database-migration --agent claude-code

SKILL.md

database-migration.SKILL.md
name: database-migration
description: Use before changing any persisted schema — by backend-developer on a server store, by web-developer on a client or server store, and by reliability-engineer when reviewing a change that migrates data. Triggers on the first column, field, index or model change, not on the deploy.

Database migration

A migration is the one change that **cannot be rolled back by reverting the commit**. Code reverts; data that has already moved does not. Treat every migration as one-way until you have proven otherwise.

Where a platform skill exists, use it — `axiom-database-migration`, `axiom-swiftdata-migration`, or the auditor for your store. **External and optional**; missing → follow this file.

Before you write it

1. **Enumerate every writer and every reader of the affected data** (`defect-hunting` §1). The migration that stops one layer short is FC-001, and this is the surface where it costs most. 2. **Name the old and new shape explicitly**, including what happens to rows that violate the new constraint *today*. There are always some. 3. **Decide expand or contract.** Almost always expand first:

  • *Expand*: add the new column nullable, write both, backfill, read new with fallback to old.
  • *Contract*: only after every deployed client and server writes the new shape. On mobile that

means **after the oldest supported app version is gone**, which is months, not the next sprint. 4. **Say how you roll back.** If the answer is "restore a backup", say that explicitly — it is a real answer, and it changes the deploy plan.

Writing it

  • **Forward-only, versioned, and ordered.** Never edit a migration that has run anywhere.
  • **Idempotent**: safe to run twice, because it will be.
  • **Transactional** where the engine allows it, and where it does not (many `ALTER TABLE` paths),

say so and make each step independently safe.

  • **Never `DROP` in the same release that stops using the column.** Two releases, minimum.
  • **Backfill in batches** with a bound, not in one statement that locks the table.
  • **A `NOT NULL` column gets a default or a backfill in the same migration** — this is the single

most common way a migration fails in production and not in dev.

Proving it

  • Run it against **a copy of real-shaped data with the awkward rows in it** — nulls, duplicates,

the pre-unicode row, the one from the first version. A migration tested only on a fresh database has been tested on the one case that never occurs.

  • Run it **twice** and confirm the second run is a no-op.
  • Run the **previous** application version against the migrated schema. During any rollout both

exist at once, and this is the check that catches it.

  • Count rows before and after, and state both. "It seemed to work" is not a result.

Output

The migration file, plus in the ticket: old shape, new shape, expand-or-contract, rollback plan, row counts before and after, and the awkward-data cases you ran it against.

Read more
@vmobifystudio
Ships withapp-dev-team

Describe your app idea in one line. Get a shipped iOS & Android app. AI App Studio is a team of 30 AI specialists — a CEO, product manager, designers, iOS/Android engineers, a code reviewer, QA, and a release manager — that works like a real software studio.

532 skills30 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
5
Star history of vmobifystudio/app-dev-team on GitHub, a chart by star-history.com

Other skills on app-dev-team.

board-doctor

board-doctor

Use to validate docs/31-board.md before spawning any agent, and to verify a developer's "DONE" claim before moving a row to…

business-model

business-model

Use when deciding or revisiting how the product makes money — pricing, tiers, trial shape, ad load, unit economics — by ceo when…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about database-migration.

Which coding agents can use database-migration?
database-migration installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.