-
Notifications
You must be signed in to change notification settings - Fork 79
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
Create automated means of updating the DB diagram #1060
Comments
michplunkett
changed the title
Create automated means of creating DB diagrams
Create automated means of updating the DB diagram
Sep 15, 2023
5 tasks
5 tasks
michplunkett
added a commit
that referenced
this issue
Jan 16, 2025
## Fixes issue #1060 ## Description of Changes Added a command to the `Makefile` that generates a DB relationship diagram. ## Tests and Linting - [x] This branch is up-to-date with the `develop` branch. - [x] Ran `make create_db_diagram` command. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment. - [x] Validated edge cases for `make create_db_diagram`. ```console (env) michaelp@Mac OpenOversight % rm database/schema.dot (env) michaelp@Mac OpenOversight % make create_db_diagram # Create new dot file showing current version of schema eralchemy -i postgresql://openoversight:terriblepassword@localhost/openoversight-dev -o database/schema.new.dot # Sort new version of schema file sort database/schema.new.dot -o schema.new.dot.sorted # Create old schema file if it does not exist and then sort it touch database/schema.dot sort database/schema.dot -o schema.dot.sorted # Create a new diagram if there are changes, otherwise clean up files Detected schema changes, making new DB relationship diagram! # Remove all sorted files rm schema.dot.sorted schema.new.dot.sorted (env) michaelp@Mac OpenOversight % make create_db_diagram # Create new dot file showing current version of schema eralchemy -i postgresql://openoversight:terriblepassword@localhost/openoversight-dev -o database/schema.new.dot # Sort new version of schema file sort database/schema.new.dot -o schema.new.dot.sorted # Create old schema file if it does not exist and then sort it touch database/schema.dot sort database/schema.dot -o schema.dot.sorted # Create a new diagram if there are changes, otherwise clean up files No schema changes detected! # Remove all sorted files rm schema.dot.sorted schema.new.dot.sorted (env) michaelp@Mac OpenOversight % ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What issue are you seeing?
Currently we have to use either an IDE or web application to create our DB diagrams. It'd be great to use something like this to create our DB diagrams and to make sure that the diagram is always up-to-date via a CI process: https://gist.github.com/edgarrmondragon/49de4263cecc5bb98577eaa5bbcad807
cc: @sea-kelp
The text was updated successfully, but these errors were encountered: