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

- Skill: `tomevault-io/generate-migration` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/generate-migration`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/generate-migration/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/generate-migration

---


# 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:
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](https://tomevault.io/claim/kolodkin) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-14 -->

