Agent Skill
2/7/2026db-migrate
Create and run database migrations for fancai. Use when changing database schema, adding columns, creating tables, or modifying SQLAlchemy models.
S
sandk0
3GitHub Stars
2Views
npx skills add sandk0/fancai
SKILL.md
| Name | db-migrate |
| Description | Create and run database migrations for fancai. Use when changing database schema, adding columns, creating tables, or modifying SQLAlchemy models. |
name: db-migrate description: Create and run database migrations for fancai. Use when changing database schema, adding columns, creating tables, or modifying SQLAlchemy models. disable-model-invocation: true allowed-tools: Read, Edit, Write, Bash, Grep, Glob
Database Migration Workflow
Steps
- Analyze Change: Understand what schema change is needed
- Update Model: Modify SQLAlchemy model in
backend/app/models/ - Update Schema: Modify Pydantic schema in
backend/app/schemas/ - Generate Migration:
cd backend && alembic revision --autogenerate -m "$ARGUMENTS" - Review Migration: Read the generated migration file, verify:
- Correct upgrade() and downgrade() operations
- No data loss in downgrade
- Proper index creation
- Test Migration:
cd backend && alembic upgrade head - Verify: Run backend tests
cd backend && pytest -v --tb=short
Conventions
- Migration message format: descriptive snake_case
- Always include downgrade() implementation
- For production: test migration on staging data first
Skills Info
Original Name:db-migrateAuthor:sandk0
Download