database-migrations
数据库迁移最佳实践,涵盖模式变更、数据迁移、回滚和零停机部署,适用于 PostgreSQL、MySQL 和常见 ORM(Prisma、Drizzle、Django、TypeORM、golang-migrate)。适用于规划或实施数据库模式变更时。
机器翻译查看英文原文
Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Django, TypeORM, golang-migrate). Use when planning or implementing database schema changes.
适用对象:数据库。自动收录 · 待核查。
原作者说明节选
从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。
查看英文原文
原文涵盖的主题
- Database Migration Patterns
- When to Activate
- Core Principles
- Migration Safety Checklist
- PostgreSQL Patterns
- Adding a Column Safely
- Adding an Index Without Downtime
- Renaming a Column (Zero-Downtime)
Safe, reversible database schema changes for production systems. 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 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 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) [ ] Data backfill is a separate migration from schema change [ ] Tested against a copy of production data [ ] Rollback plan documented Never rename direc
这里只展示节选,请以完整原文和当前要求为准。
- 来源仓库
- affaan-m/ECC
- 源文件
- .kiro/skills/database-migrations/SKILL.md
- 固定版本
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
来源与内容状态
本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。
原作者:affaan-m/ECC · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T14:01:48.556Z。
分类由名称、说明与路径规则生成,分类不代表已核实适配。
许可与权利归属
MIT。第三方内容及版权归原作者,使用条件以原文为准。
许可原文 ↗本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。
限制与注意事项
- 元数据收录不代表本站已经安装、适配、实测或进行安全审查。