Back to list
insoln

db-alembic-ops

by insoln

1🍴 0📅 Jan 11, 2026

SKILL.md


Database & Alembic Operations

When to use

  • Running or debugging Alembic migrations
  • Inspecting entities, entity_relations, import_jobs state
  • Updating schema or indexes
  • Investigating migration/startup failures

Migrations

Canonical command (repo root):

  • alembic -c alembic.ini upgrade head

Important:

  • Migrations are also applied automatically when backend starts (lifespan hook). If backend appears “stuck”, it may be running migrations.
  • NEVER CANCEL a migration command once started.

Collapsed migration history

This repo uses a collapsed history model. For clean DBs, upgrade head is the expected flow. If you’re dealing with a historical DB/schema mismatch, follow the guidance in backend/README.md / docs/dev.md rather than guessing.

Common troubleshooting

  • View backend logs (migration errors surface there):

    • docker compose -f infra/docker-compose.dev.yml logs -f backend
  • Inspect DB quickly:

    • docker compose -f infra/docker-compose.dev.yml exec db \ psql -U slack-mm -d slack-mm -P pager=off -c "select * from import_jobs order by id desc limit 5;"
  • Inspect entities:

    • docker compose -f infra/docker-compose.dev.yml exec db \ psql -U slack-mm -d slack-mm -P pager=off -c "select id, entity_type, status from entities order by id desc limit 20;"

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon