From 8788556827db19e2490e106f6b1fb7b7c6bc7111 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 24 Sep 2007 06:57:17 +0000 Subject: More fun with GraphViz svn path=/docs/rpki-db-schema.sql; revision=1015 --- scripts/graphviz-sql.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'scripts/graphviz-sql.sh') 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 | -- cgit v1.2.3