| version 1.1, 2004/11/22 14:36:35 |
version 1.2, 2004/11/30 19:20:37 |
|
|
| # 2004-11-22 - created |
# 2004-11-22 - created |
| # |
# |
| |
|
| # $Platon$ |
# $Platon: scripts/perl/mysql/mysql-graphviz-schema.pl,v 1.1 2004/11/22 14:36:35 rajo Exp $ |
| |
|
| use strict; |
use strict; |
| |
|
|
|
| digraph "DB structure" { |
digraph "DB structure" { |
| node [ shape = record ]; // sprav vsetky boxy hranate |
node [ shape = record ]; // sprav vsetky boxy hranate |
| fontsize = 24; |
fontsize = 24; |
| clusterrank = global; |
|
| |
|
| EOF |
EOF |
| ; |
; |
| |
|
| Line 46 while (my $line = <STDIN>) { |
|
| Line 44 while (my $line = <STDIN>) { |
|
| if ($line =~ m/^--.*Database:\s+(\S+)\s*$/) { |
if ($line =~ m/^--.*Database:\s+(\S+)\s*$/) { |
| print "\n};\n" if ($database ne ''); |
print "\n};\n" if ($database ne ''); |
| $database = $1; |
$database = $1; |
| print "\tsubgraph database_$database { label = \"$database\"; \n"; |
|
| } |
} |
| |
|
| if ($line =~m/^CREATE\s+TABLE\s+(\S+)/i) { |
if ($line =~m/^CREATE\s+TABLE\s+(\S+)/i) { |
| Line 81 while (my $line = <STDIN>) { |
|
| Line 78 while (my $line = <STDIN>) { |
|
| last; |
last; |
| } |
} |
| } |
} |
| print "\t\ttable_${database}_$table [ fontsize = 12, label=\"$table\\lTYPE=$table_type|{" . join('\n|', @info) . "}\""; |
print "\t\tsubgraph \"cluster_table_${database}_$table\" {\n\t\t\tfontsize = 20;\n\t\t\tstyle = bold;\n\t\t\tfontcolor = \"red\";\n\t\t\tlabel=\"$table\";\n"; |
| |
#print "\t\t\t\"table_type_${database}_$table\" [ fontsize = 12 , label = \"$table_type\" ];\n"; |
| |
print "\t\t\t\"table_${database}_$table\" [ fontsize = 12, label=\"{" . join('\n|', @info) . "}\""; |
| } |
} |
| print " ];\n" if ($line =~ m/^\)/); |
print " ];\n\t\t}\n" if ($line =~ m/^\)/); |
| |
|
| } |
} |
| |
|
| Line 92 foreach (@references) { |
|
| Line 91 foreach (@references) { |
|
| } |
} |
| |
|
| print <<EOF |
print <<EOF |
| } |
|
| } |
} |
| |
|
| EOF |
EOF |