Closed Joshua-Douglas closed 1 month ago
I left a comment on the parent issue about labeling this PR so we can find it easily if need be. Lmk your thoughts.
Waiting on #648 to merge
Hey @mira-kine & @agosmou,
Thanks for highlighting the lack of a database migration script to account for these changes! I've been relying on the API to autogenerate the db, but this approach requires you to delete the database after each update.
To alter the database more properly I added an alembic
migration script to drop the removed tables in 8657569. I also updated the old version's migration script to allow it to process databases that were created by the API without ever running alembic in d76be3d. Before this change the old migration script would throw several "table already exists errors".
Now you should be able to run alembic upgrade head
. Once you do that you'll be able to generate the most up-to-date ER diagram, without losing any of your user data.
I also updated the ER diagram to include the alembic version number table in aacbeb4.
classDiagram
class alembic_version{
*VARCHAR<32> version_num NOT NULL
}
class host{
*INTEGER id NOT NULL
VARCHAR name NOT NULL
}
class housing_program{
*INTEGER id NOT NULL
VARCHAR program_name NOT NULL
INTEGER service_provider NOT NULL
}
class housing_program_service_provider{
*INTEGER id NOT NULL
VARCHAR provider_name NOT NULL
}
class user{
*INTEGER id NOT NULL
VARCHAR email NOT NULL
}
housing_program_service_provider "1" -- "0..n" housing_program
Hey @tylerthome,
Thanks for waiting to merge. PR #648 has been merged, and I made a handful of improvements. The PR is ready for re-review.
This PR makes progress towards #655. Before I update the user models I thought it would be useful to clean out all of the unused data models, and plot the currently used models.
What changes did you make?
Rationale behind the changes?
Testing done for these changes