
generate-migration
by getsentry
generate-migrationは、ソフトウェア開発を効率化するスキルです。開発ワークフロー全体をサポートし、チームの生産性向上とコード品質の改善を実現します。
ユースケース
コード生成の効率化
ボイラープレートコードを自動生成し、開発時間を短縮。
コードレビュー支援
PRのコード変更を分析し、改善点を提案。
リファクタリング提案
コードの品質向上のためのリファクタリング案を提示。
SKILL.md
name: generate-migration description: Generate Django database migrations for Sentry. Use when creating migrations, adding/removing columns or tables, adding indexes, or resolving migration conflicts.
Generate Django Database Migrations
Commands
Generate migrations automatically based on model changes:
sentry django makemigrations
For a specific app:
sentry django makemigrations <app_name>
Generate an empty migration (for data migrations or custom work):
sentry django makemigrations <app_name> --empty
After Generating
- If you added a new model, ensure it's imported in the app's
__init__.py - Review the generated migration for correctness
- Run
sentry django sqlmigrate <app_name> <migration_name>to verify the SQL
Guidelines
Adding Columns
- Use
db_default=<value>instead ofdefault=<value>for columns with defaults - Nullable columns: use
null=True - Not null columns: must have
db_defaultset
Adding Indexes
For large tables, set is_post_deployment = True on the migration as index creation may exceed the 5s timeout.
Deleting Columns
- Make column nullable (
null=True) if not already - Remove all code references
- Replace
RemoveFieldwithSafeRemoveField(..., deletion_action=DeletionAction.MOVE_TO_PENDING) - Deploy, then create second migration with
SafeRemoveField(..., deletion_action=DeletionAction.DELETE)
Deleting Tables
- Remove all code references
- Replace
DeleteModelwithSafeDeleteModel(..., deletion_action=DeletionAction.MOVE_TO_PENDING) - Deploy, then create second migration with
SafeDeleteModel(..., deletion_action=DeletionAction.DELETE)
Renaming Columns/Tables
Don't rename in Postgres. Use db_column or Meta.db_table to keep the old name.
Resolving Merge Conflicts
If migrations_lockfile.txt conflicts:
bin/update-migration <migration_name>
This renames your migration, updates dependencies, and fixes the lockfile.
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 1000以上
3ヶ月以内に更新
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です
