summaryrefslogtreecommitdiff
path: root/util/dbgraph.pl
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-01-09 11:21:23 +0100
committerYorhel <git@yorhel.nl>2010-01-09 11:26:21 +0100
commit4531862cec3b982eb8e08e66b4ad8ea7987d4bc3 (patch)
tree80c15e44032458d3fbea45818df9d291535e9df6 /util/dbgraph.pl
parent81380525f2c4385577019ae964039dcf3c791625 (diff)
SQL: Split dump.sql into several files and merged update_2.10.sql
The functions can now be edited without having to repeat them in the update scripts. Just importing the func.sql file with \i will do the trick.
Diffstat (limited to 'util/dbgraph.pl')
-rwxr-xr-xutil/dbgraph.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/util/dbgraph.pl b/util/dbgraph.pl
index 0b72ceba..10297b66 100755
--- a/util/dbgraph.pl
+++ b/util/dbgraph.pl
@@ -2,7 +2,7 @@
# Generates a graphviz relation graph of the complete SQL database,
-# information is parsed from dump.sql (has to be in the 'current directory').
+# information is parsed from sql/schema.sql
# outputs the graph in dot format, usable as input to graphviz.
#
# Usage:
@@ -15,6 +15,10 @@ use strict;
use warnings;
+use Cwd 'abs_path';
+(my $ROOT = abs_path $0) =~ s{/util/dbgraph\.pl$}{};
+
+
my %subgraphs = (
'Producers' => [qw| FFFFCC producers producers_rev producers_relations |],
'Releases' => [qw| C8FFC8 releases releases_rev releases_media releases_platforms releases_producers releases_lang releases_vn |],
@@ -29,7 +33,7 @@ my %tables; # table_name => [ [ col1, pri ], ... ]
my @rel; # 'table:col -- table:col', ...
sub parse_dump {
- open my $R, '<', 'dump.sql' or die $!;
+ open my $R, '<', "$ROOT/util/sql/schema.sql" or die $!;
my $in='';
while (<$R>) {
chomp;