PostgreSQL、MySQL、一般的なORM(Prisma、Drizzle、Kysely、Django、TypeORM、golang-migrate)全体のスキーマ変更、データマイグレーション、ロールバック、ゼロダウンタイムデプロイメントのためのデータベースマイグレーションベストプラクティス。
d8409a4本番環境システム用の安全で可逆的なデータベーススキーマ変更。
マイグレーションを適用する前に:
-- GOOD: Nullable列、ロックなし
ALTER TABLE users ADD COLUMN avatar_url TEXT;
-- GOOD: デフォルト付きの列(Postgres 11+は即座、書き直しなし)
ALTER TABLE users ADD COLUMN is_active BOOLEAN NOT NULL DEFAULT true;
-- BAD: 既存テーブルのデフォルトなしで NOT NULL(完全書き直し必須)
ALTER TABLE users ADD COLUMN is_active BOOLEAN NOT NULL;
詳細についてはドキュメントを参照してください。
Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/database-migrations · pinned to the source commit
git clone https://github.com/affaan-m/ECC.git
cd ECC
git checkout d8409a4b0813771235555e32e3d8046a73988bfa
mkdir -p ".claude/skills/database-migrations"
cp -r "docs/ja-JP/skills/database-migrations" ".claude/skills/database-migrations"Review the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
Scanner static-checks@0.1.0 · commit d8409a4b0813. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
No static rules matched. This is not a safety guarantee.