diff options
author | Rob Austein <sra@hactrn.net> | 2007-09-24 06:57:17 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-09-24 06:57:17 +0000 |
commit | 8788556827db19e2490e106f6b1fb7b7c6bc7111 (patch) | |
tree | b08467c3f96d16fab997aea87f0121e9b305df80 /scripts/graphviz-sql.sh | |
parent | f01e70781c9f6934213eac7f101db6c002a9565d (diff) |
More fun with GraphViz
svn path=/docs/rpki-db-schema.sql; revision=1015
Diffstat (limited to 'scripts/graphviz-sql.sh')
-rw-r--r-- | scripts/graphviz-sql.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/graphviz-sql.sh b/scripts/graphviz-sql.sh index a338404a..7ff0babd 100644 --- a/scripts/graphviz-sql.sh +++ b/scripts/graphviz-sql.sh @@ -12,13 +12,16 @@ for i in *.sql do - sqlt-graph --db MySQL --output-type canon --show-datatypes $i | + sqlt-graph --db MySQL --output-type canon --show-datatypes --show-constraints $i | perl -0777 -pe ' s/\\\n/ /g; - s/\\{//g; - s/\\\|-\\ /|{/g; - s/\\ *\\ *l *-\\ /|/g; - s/\\ *\\l\\}/}/g; + s/ +/ /g; + s/\\\|/|/g; + s/\\{([a-z0-9_]+)\|/${1}|{/gi; + s/-\\ +//g; + s/\\ \\l/|/g; + s/\|\\l \\}/}/g; + s/\|\\}/}/g; s/{\n/{\n\tedge [arrowtail=none, arrowhead=crow];\n/; ' | tee ${i%.sql}.dot | |