- 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.
9 lines
142 B
Bash
Executable file
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 "$@"
|