We're working with community non-profits who have a Host Home or empty bedrooms initiative to develop a workflow management tool to make the process scalable (across all providers), reduce institutional bias, and effectively capture data.
From Tyler in comments: Recommend moving to ice box until Incubator integration established, the parameters for this solution will hinge on implementation details coordinated with ops/incubator admins
#
Overview
The API alembic database migrations are not run when starting up the API docker container. Without database migrations, future database developments could break when new API changes are introduced and tested using docker compose and existing data.
alembic is a database migration tool. It is an API core dependency and included in your Python virtual environment.
A database migration is a necessary step in the API deployment to allow existing data to continue to be available in an updated database schema. For example, say the user table contains existing data and a new version of the API creates new tables guest, coordinator, and host tables. These new tables will need to be populated with IDs of existing users. This is where an alembic migration script comes into play. When the new version of the API is developed, an alembic migration script should also be included to populate the new tables with existing data. During the docker API startup, the alembic database migration tool ought to be used to run the migration script to update the existing database, if any, so that the new version of the API can continue to use the existing data correctly.
This issue will use knowledge about Docker, alembic, SQLAlchemy, PostgreSQL.
Action Items
[ ] Study alembic database migration tool and where database migration scripts are stored in the API code.
[ ] Update Dockerfile as necessary to perform database migrations in the Postgres database container.
[ ] If necessary update README files.
Resources/Instructions
alembic is a database migration tool. It is an API core dependency and included in your Python virtual environment. After entering a Python virtual environment containing the API's dependencies. The alembic tool can be run from the command line.
Related to #607
Recommend moving to ice box until Incubator integration established, the parameters for this solution will hinge on implementation details coordinated with ops/incubator admins
Dependencies
Overview
The API
alembic
database migrations are not run when starting up the API docker container. Without database migrations, future database developments could break when new API changes are introduced and tested using docker compose and existing data.alembic
is a database migration tool. It is an API core dependency and included in your Python virtual environment.A database migration is a necessary step in the API deployment to allow existing data to continue to be available in an updated database schema. For example, say the
user
table contains existing data and a new version of the API creates new tablesguest
,coordinator
, andhost
tables. These new tables will need to be populated with IDs of existing users. This is where an alembic migration script comes into play. When the new version of the API is developed, an alembic migration script should also be included to populate the new tables with existing data. During the docker API startup, the alembic database migration tool ought to be used to run the migration script to update the existing database, if any, so that the new version of the API can continue to use the existing data correctly.This issue will use knowledge about Docker, alembic, SQLAlchemy, PostgreSQL.
Action Items
alembic
database migration tool and where database migration scripts are stored in the API code.Dockerfile
as necessary to perform database migrations in the Postgres database container.README
files.Resources/Instructions
alembic
is a database migration tool. It is an API core dependency and included in your Python virtual environment. After entering a Python virtual environment containing the API's dependencies. Thealembic
tool can be run from the command line.https://alembic.sqlalchemy.org/en/latest/ https://docs.docker.com/engine/reference/builder/