Generate Migration

Generate Alembic database migrations using GitHub Actions. Use when user asks to generate or autogenerate a migration. Use when this capability is needed.

tomevault-io a0c7c85 2 files · 1.8 KB Updated

File contents

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:

# 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:

  1. Sets up PostgreSQL in CI/CD
  2. Runs existing migrations
  3. Runs alembic revision --autogenerate
  4. Commits and pushes the migration file

After Generation

  1. Pull the latest changes: git pull
  2. Review the generated migration file
  3. 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

Converted and distributed by TomeVault — claim your Tome and manage your conversions.

tomevault-io/skills-registry/tree/main/kolodkin--aaiclick--generate-migration commit a0c7c8520e

Frequently asked questions

npx skillmds@latest add tomevault-io/generate-migration