pryscraper/docker-entrypoint.sh
cryptorugmunch 0fc69d2650 feat(db): add Alembic migrations for versioned schema changes
- Add alembic to dev deps and requirements.txt.
- Initialize alembic/ config with SQLite + Postgres support.
- Create 0001_initial_schema migration covering all 26 models.
- Add db.run_migrations() helper and  CLI command.
- Add docker-entrypoint.sh to run migrations before app start.
- Keep Base.metadata.create_all() for backward compatibility.
- Add tests verifying alembic current and upgrade head work.
2026-07-03 02:04:21 +02:00

9 lines
142 B
Bash
Executable file

#!/bin/sh
set -e
if [ "$PRY_SKIP_MIGRATIONS" != "1" ]; then
echo "Running database migrations..."
alembic upgrade head
fi
exec "$@"