Implement database schema migration tooling in order to have backwards compatible releases
Particularly, we are using Alembic and SQLAlchemy
This is the first attempt to use ADRs
Reviewer tips
Read the ADR with a markdown renderer
Experiment with the tests below
Review carefully the module organization to see if there are improvements to be made
Testing done
From main to refactor branch
git checkout main
docker compose down
docker compose up --build postgres
git checkout 232-sim-database-schema-migration
docker compose up --build database-migration
Starting from refactor branch
git checkout 232-sim-database-schema-migration
docker compose down
docker compose up --build database-migration
Notes
docker compose down is used to delete the data from the postgres container
Possible future improvements
Now that we have the db model in Python written with SQLAlchemy, we can use these datatypes instead of using dictionaries to improve the safety of our code
Now it's also clearer to see that we are missing some things in the data model
some columns shouldn't be nullable
some columns should be FK references
To keep PR size at its minimum, I've left this things out. I'll create some issues for them
What
Reviewer tips
Testing done
From main to refactor branch
Starting from refactor branch
Notes
docker compose down
is used to delete the data from the postgres containerPossible future improvements
To keep PR size at its minimum, I've left this things out. I'll create some issues for them