database-migrations
Skill1 starsChanged 33 days agoMITView on GitHub
Plan and review schema and data migrations that deploy without downtime or data loss, using expand-contract, batching and tested rollback. Use when adding, renaming or removing columns, tables, indexes or constraints, or backfilling data.
71 other projects use a version of this.
Adopted by
Most recently taken up by
- KevinLoichot/everything-claude-codetheir own version, first seen Nov 29, 2026
- aayushsoam/clawbot-plustheir own version, first seen Nov 29, 2026
- multiplex-ai/muggle-ai-teamstheir own version, first seen Nov 29, 2026
- Cyvid7-Darus10/claude-code-configtheir own version, first seen Nov 29, 2026
- satvikgbusiness-jpg/Claude-skillstheir own version, first seen Nov 29, 2026
- leileigwl/claude-skillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use docker-and-compose, add-a-use-case and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
JameMy0001Skilldocker-and-compose
Production containerization patterns, multi-stage Dockerfiles, Docker Compose orchestrations, non-root security hardening, and cache optimization.
Also in 6 projects that use this
LeanMeanCleanAppsSkilladd-a-use-case
How to add a command or query to the Application layer as a vertical slice (request, handler, validator, tests) using source-generated Mediator. Use when adding a new feature, a new query, or a new write operation.
Also in 5 projects that use this
LeanMeanCleanAppsSkillbranches-and-pull-requests
Branch naming (feature/, fix/, chore/), how labels and release notes follow from the branch, the pull request template, and how changes get merged in the template repository. Use when creating a branch, writing a commit or opening a pull request.
Also in 5 projects that use this
- +9 more from LeanMeanCleanApps
Other versions71 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 71
- LeanMeanCleanApps/CleanMinimalApi★ 401same name
- loulanyue/awesome-claude-notes★ 272same name
- langchain-ai/skills-benchmarks★ 116same name
- Fmarzochi/EGC★ 61same name
- skateddu/claude-code-python-setup★ 28same name
- LeanMeanCleanApps/CleanGraphQLApi★ 13same name
- wpank/ai★ 11same name
- gongyijie85/dsh-ecc★ 8same name
- reddygopalkrishna/developer-agent-skills★ 8same name
- zero-click/zero-ratchet★ 8same name
61 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository105 other files it gives its agents.
- AGENTS.mdAGENTS.md
- instructions/AGENTS.mdAGENTS.md
- accessibility-reviewSkill
- agent-evaluationSkill
- agent-guardrailsSkill
- agenthub-routerSkill
- ai-red-teamingSkill
- ansible-reviewSkill
- api-designSkill
- api-integrationSkill
- architecture-decisionSkill
- backup-restoreSkill
- caching-strategySkill
- chaos-engineeringSkill
- ci-cd-pipeline-designSkill
- cloud-cost-optimizationSkill
- cloud-iam-least-privilegeSkill
- code-reviewSkill
- container-image-optimizationSkill
- cyber-resilience-actSkill
- data-pipeline-reviewSkill
- data-privacySkill
- data-quality-checksSkill
- debugging-root-causeSkill
- dependency-auditSkill
- dependency-upgradeSkill
- disaster-recovery-drillSkill
- docker-hardeningSkill
- documentationSkill
- dora-readinessSkill
- dpiaSkill
- email-deliverabilitySkill
- embedding-model-selectionSkill
- error-handling-reviewSkill
- eu-ai-act-readinessSkill
- eu-data-sovereigntySkill
- european-accessibility-actSkill
- event-driven-architectureSkill
- feature-flagsSkill
- frontend-reviewSkill
- gdpr-dsar-handlingSkill
- github-actionsSkill
- gitlab-ciSkill
- git-workflowSkill
- go-developmentSkill
- graphql-api-reviewSkill
- helm-chart-reviewSkill
- i18n-localizationSkill
- incident-responseSkill
- java-spring-reviewSkill
- kubernetes-reviewSkill
- linux-server-hardeningSkill
- llm-cost-analysisSkill
- llm-gateway-routingSkill
- llm-observabilitySkill
- llm-output-evaluationSkill
- llm-structured-extractionSkill
- load-testingSkill
- local-llm-servingSkill
- log-analysisSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 68 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 52
No step breaks the currently deployed application version.
- Distinctive: line 61
Never run migrations against production without approval and a fresh backup.
“Common” is measured: kept by at least 6 in 10 of the 68 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Zero-Downtime Database Migrations
Goal
Change the schema while old and new application versions run side by side, with a verified way back.
Inputs
- Migration files and the ORM or migration tool in use.
- Table sizes and row counts, write rate, replication setup, database engine and version.
- Deployment model: rolling, blue-green, or a single instance with a restart.
Procedure
- Classify each change.
Change Risk add nullable column, new table low add index on a large table locks writes unless built concurrently/online add NOT NULL, foreign key, check constraint full-table validation, may lock rename or drop column or table breaks running code change type table rewrite on many engines - Apply expand–contract. Expand: add the new structure alongside the old. Migrate: deploy code that writes both and reads new with fallback; backfill. Contract: after every instance runs the new code, remove the old structure in a later release.
- Use online operations. PostgreSQL:
CREATE INDEX CONCURRENTLY,ADD CONSTRAINT … NOT VALIDfollowed byVALIDATE CONSTRAINT, setlock_timeoutso a migration fails fast instead of queueing behind long transactions. MySQL: online DDL or a tool such as gh-ost or pt-online-schema-change. - Backfill in batches. Batches by primary-key range (for example 1–10k rows), commit per batch, throttle, make it resumable and idempotent, and monitor replication lag.
- Plan rollback. For each step write the down-path. Irreversible steps (drops, lossy type changes) need a backup or an export of the affected data, verified restorable.
- Rehearse on a production-sized copy: measure duration and locks, and check the query plans of critical queries.
- Release and observe. Error rate, latency, locks and replication lag during and after; proceed to contract only after a stable period.
Example fixture
-- Rename users.fullname -> users.display_name without downtime
ALTER TABLE users ADD COLUMN display_name text; -- release 1 (expand)
-- app writes both, reads display_name with fallback to fullname
UPDATE users SET display_name = fullname
WHERE id BETWEEN $1 AND $2 AND display_name IS NULL; -- batched backfill
-- release 2: app reads/writes display_name only
ALTER TABLE users DROP COLUMN fullname; -- release 3 (contract)Common rationalizations
| Rationalization | Reality |
| The table is small, locking is fine. | Tables grow, and even a small table blocks every query queued behind a long transaction. Set lock_timeout and measure. |
| We'll roll back if it breaks. | Many schema changes (drops, lossy type changes) cannot be rolled back without a backup. Plan the down-path first. |
| We can rename the column in one release. | Running instances of the old version will fail. Use expand–contract across releases. |
Acceptance checks
- No step breaks the currently deployed application version.
- Long-locking statements are replaced by online variants or scheduled with explicit approval.
- Backfill is idempotent and resumable; batch size and duration were measured.
- Rollback is documented per step; irreversible steps have a verified backup.
Output
Ordered migration plan across releases, scripts, rehearsal measurements and a rollback plan.
Safety
Never run migrations against production without approval and a fresh backup. Do not drop data "because it seems unused" without evidence of no reads.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

