summaryrefslogtreecommitdiff
path: root/util/dbgraph.pl
diff options
context:
space:
mode:
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;