| name | generate-migration |
| description | Generate Alembic database migrations using GitHub Actions. Use when user asks to generate or autogenerate a migration. |
Generate Migration Skill
Trigger a GitHub Actions workflow to autogenerate Alembic migrations.
Usage
gh workflow run generate-migration.yaml -f message="your migration description"
Then monitor:
RUN_ID=$(gh run list --workflow=generate-migration.yaml --limit 1 --json databaseId --jq '.[0].databaseId')
gh run watch $RUN_ID
How It Works
The workflow:
- Sets up PostgreSQL in CI/CD
- Runs existing migrations
- Runs
alembic revision --autogenerate
- Commits and pushes the migration file
After Generation
- Pull the latest changes:
git pull
- Review the generated migration file
- Push and let tests run
Troubleshooting
- Workflow fails:
gh run view <run-id> --log
- No changes detected: Verify model changes are saved
- Merge conflicts: Pull latest before generating