Generate Migration Skill
Trigger a GitHub Actions workflow to autogenerate Alembic migrations.
Usage
bash
gh workflow run generate-migration.yaml -f message="your migration description"
Then monitor:
bash
# Get run ID RUN_ID=$(gh run list --workflow=generate-migration.yaml --limit 1 --json databaseId --jq '.[0].databaseId') # Watch it 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