chore(pry): entrypoint runs alembic migrations before uvicorn
This commit is contained in:
parent
fa59859112
commit
473434fb62
2 changed files with 31 additions and 2 deletions
|
|
@ -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 "$@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue