Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Kysely, Django, TypeORM, golang-migrate).
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Database Migration Patterns
Safe, reversible database schema changes for production systems.
## When to Activate
- Creating or altering database tables
- Adding/removing columns or indexes
- Running data migrations (backfill, transform)
- Planning zero-downtime schema changes
- Setting up migration tooling for a new project
## Core Principles
1. **Every change is a migration** — never alter production databases manually
2. **Migrations are forward-only in production** — rollbacks use new forward migrations
3. **Schema and data migrations are separate** — never mix DDL and DML in one migration
4. **Test migrations against production-sized data** — a migration that works on 100 rows may lock on 10M
5. **Migrations are immutable once deployed** — never edit a migration that has run in production
## Migration Safety Checklist
Before applying any migration:
- [ ] Migration has both UP and DOWN (or is explicitly marked irreversible)
- [ ] No full table locks on large tables (use concurrent operations)
- [ ] New columns have defaults or are nullable (never add NOT NULL without default)
- [ ] Indexes created concurrently (not inline with CREATE TABLE for existing tables)
…
The line at the top of this page pins the label git:20260512.6523792, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_45hqlpylidham6j5
GET https://markdownregistry.com/api/v1/resolve?ref=hashgraph-online/awesome-codex-plugins/database-migrations
GET https://markdownregistry.com/api/v1/blob/645290c5763d31649bd6c071245b53198cdaf4438d9aa091b6ee6bd3ab085fea
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
hashgraph-online/awesome-codex-plugins · plugins/321zz321/computefirst-skill/skills/computefirst/SKILL.md · Use ComputeFirst for exact or deterministic computation when model-side arithmetic or manual transformation risks being…
hashgraph-online/awesome-codex-plugins · plugins/6Delta9/task-scheduler-codex-plugin/skills/task-planner/SKILL.md · Turn a list of goals, tasks, deadlines, and working constraints into a practical schedule with next actions and…
hashgraph-online/awesome-codex-plugins · plugins/6jeffr3y/burpsuite-mcp-bridge/skills/use-burpsuite-mcp-bridge/SKILL.md · Operate BurpSuite MCP Bridge for professional, authorized web testing. Use when Codex needs to inspect Burp…
hashgraph-online/awesome-codex-plugins · plugins/ADanMan/clueless/skills/clueless-blindspots/SKILL.md · Use when the user asks what they are not seeing, what they forgot, what could go wrong, or what an expert would say…
affaan-m/ecc · docs/es/skills/database-migrations/SKILL.md · Buenas prácticas de migración de base de datos para cambios de esquema, migraciones de datos, rollbacks y despliegues…
affaan-m/ecc · .kiro/skills/database-migrations/SKILL.md · Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across…
datit309/supergraph · plugins/supergraph/skills/database-migrations/SKILL.md · Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across…
chadixearth/graphyloop · skills/database-migrations/SKILL.md · Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across…