summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-08-14 15:19:18 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-08-14 15:19:18 +0000
commit889e9b9c481170c94f0b5e773e7c39d27b921a43 (patch)
tree7515e85ee690916f7549fd27bd0a2879657d913b /util
parent99214c46848b3e4706552cfb87043861c1b5f140 (diff)
Added screenshots (not entirely finished, still needs some tweaking and polishing)
git-svn-id: svn://vndb.org/vndb@83 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'util')
-rw-r--r--util/dump.sql12
-rw-r--r--util/fcgi.pl3
-rwxr-xr-xutil/updates/update_1.21.pl15
-rw-r--r--util/updates/update_1.21.sql12
4 files changed, 40 insertions, 2 deletions
diff --git a/util/dump.sql b/util/dump.sql
index 884c06e8..f2db8bc2 100644
--- a/util/dump.sql
+++ b/util/dump.sql
@@ -214,6 +214,14 @@ CREATE TABLE vn_rev (
l_renai varchar(100) NOT NULL DEFAULT ''
);
+-- vn_screenshots
+CREATE TABLE vn_screenshots (
+ vid integer NOT NULL DEFAULT 0,
+ scr integer NOT NULL DEFAULT 0,
+ nsfw smallint NOT NULL DEFAULT 0,
+ PRIMARY KEY(vid, scr)
+);
+
-- vnlists
CREATE TABLE vnlists (
uid integer DEFAULT 0,
@@ -278,6 +286,7 @@ ALTER TABLE vn_relations ADD FOREIGN KEY (vid1) REFERENCES vn_rev
ALTER TABLE vn_relations ADD FOREIGN KEY (vid2) REFERENCES vn (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE vn_rev ADD FOREIGN KEY (id) REFERENCES changes (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE vn_rev ADD FOREIGN KEY (vid) REFERENCES vn (id) DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE vn_screenshots ADD FOREIGN KEY (vid) REFERENCES vn (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE vnlists ADD FOREIGN KEY (uid) REFERENCES users (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE vnlists ADD FOREIGN KEY (vid) REFERENCES vn (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE votes ADD FOREIGN KEY (uid) REFERENCES users (id) DEFERRABLE INITIALLY DEFERRED;
@@ -379,9 +388,10 @@ $$ LANGUAGE plpgsql;
---------------------------------
--- Two sequences used for cover and relation graph ID numbers
+-- Sequences used for cover, relation graph and screenshot ID numbers
CREATE SEQUENCE covers_seq;
CREATE SEQUENCE relgraph_seq;
+CREATE SEQUENCE screenshots_seq;
INSERT INTO users (id, username, mail, rank)
VALUES (0, 'deleted', 'del@vndb.org', 0);
diff --git a/util/fcgi.pl b/util/fcgi.pl
index 60f3c324..a1fb1d92 100644
--- a/util/fcgi.pl
+++ b/util/fcgi.pl
@@ -34,6 +34,7 @@ while($req->Accept() >= 0) {
eval {
CGI::Minimal::reset_globals;
CGI::Minimal::allow_hybrid_post_get(1);
+ CGI::Minimal::max_read_size(5*1024*1024); # allow 5MB of POST data
$c = CGI::Minimal->new();
};
if($@) {
@@ -116,7 +117,7 @@ while($req->Accept() >= 0) {
}
sub send500 {
- print "HTTP/1.0 500 Internal Server Error\n";
+ print "Status: 500 Internal Server Error\n";
print "Content-Type: text/html\n";
print "X-Sendfile: /www/vndb/www/files/err.html\n\n";
}
diff --git a/util/updates/update_1.21.pl b/util/updates/update_1.21.pl
new file mode 100755
index 00000000..d59d3603
--- /dev/null
+++ b/util/updates/update_1.21.pl
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+
+# create static/sf and static/st with subdirectories
+chdir '/www/vndb/static';
+
+sub mk {
+ for (@_) {
+ mkdir $_ or die "mkdir: $_: $!";
+ chmod 0777, $_ or die "chmod: $_: $!";
+ }
+}
+
+mk 'sf', 'st';
+mk sprintf('sf/%02d',$_), sprintf('st/%02d',$_) for (0..99);
+
diff --git a/util/updates/update_1.21.sql b/util/updates/update_1.21.sql
new file mode 100644
index 00000000..c8457498
--- /dev/null
+++ b/util/updates/update_1.21.sql
@@ -0,0 +1,12 @@
+
+-- screenshots
+--CREATE SEQUENCE screenshots_seq;
+
+CREATE TABLE vn_screenshots (
+ vid integer NOT NULL DEFAULT 0 REFERENCES vn_rev (id) DEFERRABLE INITIALLY DEFERRED,
+ scr integer NOT NULL DEFAULT 0,
+ nsfw smallint NOT NULL DEFAULT 0,
+ PRIMARY KEY(vid, scr)
+) WITHOUT OIDS;
+
+