The diagram below illustrates a simple path for enacting changes to the data model, and using Alembic to automate the database changes:
- Update
database/models.py
(e.g., add columns, tables) - Use alembic to compute the revisions
cd database
alembic revision --autogenerate -m "Added Tables and Columns"
- Edit the revision file to signify your understanding
- Activate the change
alembic upgrade head
Then, run rebuild-from-model
. For more information, see Database Design Changes.