Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1150 from jeremycline/schema-image
Add a database schema image to the docs
- Loading branch information
Showing
5 changed files
with
52 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python2 | ||
""" | ||
Generate an image of the database schema | ||
""" | ||
from sqlalchemy_schemadisplay import create_schema_graph | ||
|
||
from bodhi.server import models | ||
|
||
|
||
def write_graph(filename): | ||
graph = create_schema_graph( | ||
metadata=models.metadata, | ||
show_datatypes=False, | ||
show_indexes=False, | ||
rankdir='LR', | ||
concentrate=False | ||
) | ||
graph.write_png(filename) | ||
|
||
|
||
if __name__ == '__main__': | ||
write_graph('images/database.png') |