database-migrations
OfficialPostgreSQL、MySQL、一般的なORM(Prisma、Drizzle、Kysely、Django、TypeORM、golang-migrate)全体のスキーマ変更、データマイグレーション、ロールバック、ゼロダウンタイムデプロイメントのためのデータベースマイグレーションベストプラクティス。
What this skill does
When applied, it prepends a system prompt before your request is sent — no extra calls and no change to how you are billed beyond the added tokens.
--- name: database-migrations description: PostgreSQL、MySQL、一般的なORM(Prisma、Drizzle、Kysely、Django、TypeORM、golang-migrate)全体のスキーマ変更、データマイグレーション、ロールバック、ゼロダウンタイムデプロイメントのためのデータベースマイグレーションベストプラクティス。 origin: ECC --- # データベースマイグレーションパターン 本番環境システム用の安全で可逆的なデータベーススキーマ変更。 ## アクティベーション時期 - データベーステーブルの作成または変更 - 列またはインデックスの追加/削除 - データマイグレーション(バックフィル、変換)の実行 - ゼロダウンタイムスキーマ変更を計画 - 新しいプロジェクト用のマイグレーションツール設定 ## コア原則 1. **すべての変更はマイグレーション** — 本番環境データベースを手動で変更しない 2. **マイグレーションは本番環境で前方のみ** — ロールバックは新しい前向きマイグレーション使用 3. **スキーマとデータマイグレーションは分離** — 1つのマイグレーションでDDLとDMLを混ぜない 4. **本番環境サイズのデータに対してマイグレーションをテスト** — 100行で機能するマイグレーション10M上でロックされる場合がある 5. **マイグレーションは展開後は不変** — 本番環境で実行されたマイグレーションを編集しない ## マイグレーション安全チェックリスト マイグレーションを適用する前に: - [ ] マイグレーションはUPとDOWNの両方を持つ(または明示的に不可逆としてマーク) - [ ] 大型テーブルの完全テーブルロックなし(並行操作使用) - [ ] 新しい列はデフォルトまたはnullable(デフォルトなしでNOT NULLを追加しない) - [ ] インデックスは並行して作成(既存テーブルのCREATE TABLEでインライン化しない) - [ ] データバックフィルはスキーマ変更から分離したマイグレーション - [ ] 本番環境データのコピーに対してテスト - [ ] ロールバック計画を文書化 ## PostgreSQL パターン ### 列を安全に追加 ```sql -- 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; ``` 詳細についてはドキュメントを参照してください。
Use this skill
Add a "skill" field with the skill’s ID to your chat completion request. It is applied server-side before your prompt is sent — no extra calls.
{
"model": "gpt-4o-mini",
"skill": "imp-e93d1d9a-a293-4e44-906e-c1c627bbb8ff",
"messages": [{ "role": "user", "content": "…" }]
}Install the skill, enable it in your dashboard and (optionally) limit it to specific models. It then applies automatically to every matching request — with no "skill" field to send each time.
Set it up in your dashboardMore skills
Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.
Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.
List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.
Create, search, and manage Bear notes via grizzly CLI.
Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
BluOS CLI (blu) for discovery, playback, grouping, and volume.
Capture frames or clips from RTSP/ONVIF cameras.
Search, install, update, sync, or publish agent skills with the ClawHub CLI and registry.