ER diagram for OpenStack database
If you want to generate an entity-relationship diagram for the tables in an OpenStack Compute (nova) database, this script will introspect the sqlalchemy models and generate a png.
#!/usr/bin/env python
import ConfigParser
from sqlalchemy import MetaData
from sqlalchemy_schemadisplay import create_schema_graph
config = ConfigParser.RawConfigParser()
config.read('/etc/nova/nova.conf')
connection = config.get("DEFAULT", "sql_connection")
graph = create_schema_graph(metadata=MetaData(connection),
show_datatypes=False,show the datatypes
show_indexes=False,
rankdir='LR',
concentrate=False)
graph.write_png('dbschema.png')
Written by Lorin Hochstein
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#