summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2014-12-02 11:39:35 +0100
committerYorhel <git@yorhel.nl>2014-12-02 11:39:35 +0100
commit65db0718f4a3e42930dbf660068c1c309d47b08a (patch)
tree2a47031435820efa88e9aa5a804c60faf9ce829d
parent42e5a4793fc02ef54805ab5706830bbb2e1bd086 (diff)
Completely drop l_vnn column from VN info
Used to link to a visual-novels.net review or something. Links have been hidden and dead since ages. No need to keep the column around.
-rw-r--r--lib/VNDB/DB/VN.pm4
-rw-r--r--lib/VNDB/Handler/VNEdit.pm5
-rw-r--r--util/sql/func.sql4
-rw-r--r--util/sql/schema.sql1
-rw-r--r--util/updates/update_2.24.sql4
5 files changed, 10 insertions, 8 deletions
diff --git a/lib/VNDB/DB/VN.pm b/lib/VNDB/DB/VN.pm
index cd844a27..090f9ecb 100644
--- a/lib/VNDB/DB/VN.pm
+++ b/lib/VNDB/DB/VN.pm
@@ -103,7 +103,7 @@ sub dbVNGet {
my @select = ( # see https://rt.cpan.org/Ticket/Display.html?id=54224 for the cast on c_languages and c_platforms
qw|v.id v.locked v.hidden v.c_released v.c_languages::text[] v.c_platforms::text[] vr.title vr.original v.rgraph|, 'vr.id AS cid',
$o{what} =~ /extended/ ? (
- qw|vr.alias vr.image vr.img_nsfw vr.length vr.desc vr.l_wp vr.l_encubed vr.l_renai vr.l_vnn| ) : (),
+ qw|vr.alias vr.image vr.img_nsfw vr.length vr.desc vr.l_wp vr.l_encubed vr.l_renai| ) : (),
$o{what} =~ /changes/ ? (
qw|c.requester c.comments v.latest u.username c.rev c.ihid c.ilock|, q|extract('epoch' from c.added) as added|) : (),
$o{what} =~ /relgraph/ ? 'vg.svg' : (),
@@ -203,7 +203,7 @@ sub dbVNRevisionInsert {
$o->{img_nsfw} = $o->{img_nsfw}?1:0 if exists $o->{img_nsfw};
my %set = map exists($o->{$_}) ? (qq|"$_" = ?| => $o->{$_}) : (),
- qw|title original desc alias image img_nsfw length l_wp l_encubed l_renai l_vnn|;
+ qw|title original desc alias image img_nsfw length l_wp l_encubed l_renai|;
$self->dbExec('UPDATE edit_vn !H', \%set) if keys %set;
if($o->{screenshots}) {
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm
index dd2a883e..13877fa2 100644
--- a/lib/VNDB/Handler/VNEdit.pm
+++ b/lib/VNDB/Handler/VNEdit.pm
@@ -87,7 +87,7 @@ sub edit {
my $r = $v ? $self->dbReleaseGet(vid => $v->{id}) : [];
my %b4 = !$vid ? () : (
- (map { $_ => $v->{$_} } qw|title original desc alias length l_wp l_encubed l_renai l_vnn image img_nsfw ihid ilock|),
+ (map { $_ => $v->{$_} } qw|title original desc alias length l_wp l_encubed l_renai image img_nsfw ihid ilock|),
anime => join(' ', sort { $a <=> $b } map $_->{id}, @{$v->{anime}}),
vnrelations => join('|||', map $_->{relation}.','.$_->{id}.','.($_->{official}?1:0).','.$_->{title}, sort { $a->{id} <=> $b->{id} } @{$v->{relations}}),
screenshots => join(' ', map sprintf('%d,%d,%d', $_->{id}, $_->{nsfw}?1:0, $_->{rid}), @{$v->{screenshots}}),
@@ -105,7 +105,6 @@ sub edit {
{ post => 'l_wp', required => 0, default => '', maxlength => 150 },
{ post => 'l_encubed', required => 0, default => '', maxlength => 100 },
{ post => 'l_renai', required => 0, default => '', maxlength => 100 },
- { post => 'l_vnn', required => 0, default => $b4{l_vnn}||0, template => 'int' },
{ post => 'anime', required => 0, default => '' },
{ post => 'image', required => 0, default => 0, template => 'int' },
{ post => 'img_nsfw', required => 0, default => 0 },
@@ -149,7 +148,7 @@ sub edit {
# perform the edit/add
my $nrev = $self->dbItemEdit(v => $vid ? $v->{cid} : undef,
- (map { $_ => $frm->{$_} } qw|title original image alias desc length l_wp l_encubed l_renai l_vnn editsum img_nsfw ihid ilock|),
+ (map { $_ => $frm->{$_} } qw|title original image alias desc length l_wp l_encubed l_renai editsum img_nsfw ihid ilock|),
anime => [ keys %$anime ],
relations => $relations,
screenshots => $screenshots,
diff --git a/util/sql/func.sql b/util/sql/func.sql
index 4bcc8d99..360f52f6 100644
--- a/util/sql/func.sql
+++ b/util/sql/func.sql
@@ -275,7 +275,7 @@ BEGIN
INSERT INTO edit_vn DEFAULT VALUES;
-- otherwise, load revision
ELSE
- INSERT INTO edit_vn SELECT title, alias, img_nsfw, length, "desc", l_wp, l_vnn, image, l_encubed, l_renai, original FROM vn_rev WHERE id = cid;
+ INSERT INTO edit_vn SELECT title, alias, img_nsfw, length, "desc", l_wp, image, l_encubed, l_renai, original FROM vn_rev WHERE id = cid;
INSERT INTO edit_vn_anime SELECT aid FROM vn_anime WHERE vid = cid;
INSERT INTO edit_vn_relations SELECT vid2, relation, official FROM vn_relations WHERE vid1 = cid;
INSERT INTO edit_vn_screenshots SELECT scr, nsfw, rid FROM vn_screenshots WHERE vid = cid;
@@ -293,7 +293,7 @@ BEGIN
RAISE 'edit_vn must have exactly one row!';
END IF;
SELECT INTO r * FROM edit_commit();
- INSERT INTO vn_rev SELECT r.cid, r.iid, title, alias, img_nsfw, length, "desc", l_wp, l_vnn, image, l_encubed, l_renai, original FROM edit_vn;
+ INSERT INTO vn_rev SELECT r.cid, r.iid, title, alias, img_nsfw, length, "desc", l_wp, image, l_encubed, l_renai, original FROM edit_vn;
INSERT INTO vn_anime SELECT r.cid, aid FROM edit_vn_anime;
INSERT INTO vn_relations SELECT r.cid, vid, relation, official FROM edit_vn_relations;
INSERT INTO vn_screenshots SELECT r.cid, scr, nsfw, rid FROM edit_vn_screenshots;
diff --git a/util/sql/schema.sql b/util/sql/schema.sql
index 32561dc9..a3bb29b0 100644
--- a/util/sql/schema.sql
+++ b/util/sql/schema.sql
@@ -439,7 +439,6 @@ CREATE TABLE vn_rev (
length smallint NOT NULL DEFAULT 0,
"desc" text NOT NULL DEFAULT '',
l_wp varchar(150) NOT NULL DEFAULT '',
- l_vnn integer NOT NULL DEFAULT 0,
image integer NOT NULL DEFAULT 0,
l_encubed varchar(100) NOT NULL DEFAULT '',
l_renai varchar(100) NOT NULL DEFAULT '',
diff --git a/util/updates/update_2.24.sql b/util/updates/update_2.24.sql
index 6bc33313..011588cf 100644
--- a/util/updates/update_2.24.sql
+++ b/util/updates/update_2.24.sql
@@ -8,3 +8,7 @@ UPDATE sessions SET token = digest(token, 'sha1');
-- No more 'charedit' permission flag
UPDATE users SET perm = (perm & ~8);
+
+
+-- Completely remove l_vnn column
+ALTER TABLE vn_rev DROP COLUMN l_vnn;