Since we're going to be workshopping database ideas, we need a good way to reset the database and easily mock up some new data.
- Delete current sqlite database by either calling
python manage.py flushor simply deleting the db file. - Modify the
hospital/management/commands/create_db.pycommand to create new instances/relations. - Call custom management command via
python manage.py create_db. This will make the migrations and populate the db. - Use
python manage.py shell_plusto enter interactive shell to verify.
This assumes Ubuntu May need alternate steps for windows/mac
-
Setup env/packages and pip install requirements
-
Install graphviz library
sudo apt-get install graphviz -
Create png of the ERD
python manage.py graph_models hospital --output=erd.png