From 9ba57996ed6d7fe3dd0d0c1fe5e1b3827b8a2b8a Mon Sep 17 00:00:00 2001 From: Yorhel Date: Fri, 25 Sep 2009 18:37:54 +0200 Subject: Use inline SVG for relation graphs The graphs are now stored in the DB in SVG format, the static/rg/ directory can be removed (not used anymore). SVG data is stored using the xml data type, so now I can say for sure you'd need at least PostgreSQL 8.3. This feature still needs some tweaking, though. Current state isn't perfect. --- util/init.pl | 2 +- util/updates/update_2.8.sql | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 util/updates/update_2.8.sql (limited to 'util') diff --git a/util/init.pl b/util/init.pl index 5c171705..ac533174 100755 --- a/util/init.pl +++ b/util/init.pl @@ -22,7 +22,7 @@ print "\n"; print "Creating directory structures...\n"; -for my $d (qw| cv rg st sf |) { +for my $d (qw| cv st sf |) { print " /static/$d\n"; mkdir "$ROOT/static/$d" or die "mkdir '$ROOT/static/$d': $!\n"; for my $i (0..99) { diff --git a/util/updates/update_2.8.sql b/util/updates/update_2.8.sql new file mode 100644 index 00000000..a48c1e73 --- /dev/null +++ b/util/updates/update_2.8.sql @@ -0,0 +1,16 @@ + +-- !BEFORE! running this SQL file, make sure to kill Multi, +-- After running this SQL file, also make sure to do a: +-- $ rm -r static/rg/ +-- And start multi again + +-- VN Relation graphs are stored in the database as SVG - no cmaps and .png anymore +UPDATE vn SET rgraph = NULL; +ALTER TABLE vn DROP CONSTRAINT vn_rgraph_fkey; +DROP TABLE relgraph; +CREATE TABLE vn_graphs ( + id SERIAL PRIMARY KEY, + svg xml NOT NULL +); +ALTER TABLE vn ADD FOREIGN KEY (rgraph) REFERENCES vn_graphs (id); + -- cgit v1.2.3