-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ER Diagram, remove unused db models #657
Conversation
I left a comment on the parent issue about labeling this PR so we can find it easily if need be. Lmk your thoughts. |
--config-settings="--global-option="-LC:\Program Files\Graphviz\lib" ` | ||
pygraphviz | ||
python -m pip install eralchemy2 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldnt get this to work on Windows - tried putting it into my path and everything. Im thinking it has something to do with it being a C program. Not sure.
I jumped into WSL2 and it installed well then.
sudo apt install graphviz libgraphviz-dev pkg-config
python3 -m pip install pygraphviz
python3 -m pip install eralchemy2
then from the api directory I got it to work with:
eralchemy2 -i "sqlite:///./homeuniteus.db" -o "HomeUniteUsDataModel.md"
However, it printed out the old ERD. I think it's because the alembic upgrade head
create the sqllite db with the old migration.
Will this PR add a db migration that removes the unused tables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Josh, this will definitely help visualize #655 changes! The ER diagram successfully printed out for me, though right now it prints out the old ER. Other than that, this PR looks good to me.
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 Now you should be able to run 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