-
Notifications
You must be signed in to change notification settings - Fork 26
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
Update database diagram using MySQL Workshop #22
Conversation
@@ -131,7 +131,9 @@ Note that the ``cat`` example above will also add the ATHS info for the | |||
Architecture Diagrams | |||
--------------------- |
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.
As a side note, this section is extremely buried in our docs right now, suggestions for reorganizing welcome for a follow-up PR :)
|
||
.. image:: ../diagrams/securedrop-database.png | ||
:width: 100% |
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.
This ensures that clicking the diagram will display the full-size version.
Oh, I see, the little yellow light bulb is the indicator. Just weird to see "PRIMARY" by itself there. |
I think it's supposed to be a key icon. Yeah, mysql-workbench doesn't let you name that in the "indexes" section, presumably because "there can be only one" (cue Highlander theme). |
|
^ oops i keep pressing Ctrl+Enter because SecureDrop client is training me to!!
I don't think it normalizes anything and could be moved into the sources table |
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.
lgtm!
Status
Ready for review
Description of Changes
Brings the database diagram up to date and includes cardinalities in crow's foot notation.
This diagram was created using MySQL Workshop, which is open source and cross-platform (while designed for MySQL, there does not appear to be a conflict between its capabilities and our relatively modest requirements). To create it, I first dumped the SQLite database and imported it using the "Import > Reverse Engineer MySQL Create Script" option. The main things I manually adjusted after that are:
Resolves #7.
Alternatives considered
I evaluated SQLeton and ERAlchemy for fully automatic diagram generation. Neither choice offered sufficient flexibility to allow for correcting cardinalities, choosing notation styles, optimizing placement, or configuring the display of column flags such as NOT NULL or UNIQUE.
MySQL Workbench seemed a good middle ground between partial automation and partial manual effort.
SQLeton generated diagram
ERAlchemy generated diagram
Review
make dev
in your SecureDrop checkout directorydocker exec -it securedrop-dev-0 bash
sqlite3 /var/lib/securedrop/db.sqlite
.schema
Compare the output with the diagram
securedrop-database.png
from this PR:Checklist (Optional)
make docs-lint
) passed locallymake docs
) docs at http://localhost:8000