chore(pry): entrypoint runs alembic migrations before uvicorn

This commit is contained in:
opencode 2026-07-06 20:52:23 +07:00
parent fa59859112
commit 473434fb62
2 changed files with 31 additions and 2 deletions

View file

@ -2,8 +2,12 @@
set -e
if [ "$PRY_SKIP_MIGRATIONS" != "1" ]; then
echo "Running database migrations..."
alembic upgrade head
echo "[pry] stamping DB as up-to-date (preserves data)..."
if ! alembic stamp head 2>/dev/null; then
echo "[pry] stamp failed, running upgrade head..."
alembic upgrade head
fi
echo "[pry] alembic current: $(alembic current 2>/dev/null || echo 'unknown')"
fi
exec "$@"