summaryrefslogtreecommitdiff
path: root/util/sql
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-11-10 21:01:14 +0100
committerYorhel <git@yorhel.nl>2010-11-10 21:04:37 +0100
commit15808bc64c7717c0a157c24ee9bfd0a097daf707 (patch)
treecc8782101c744ae43f6f9e2529ce85582c892600 /util/sql
parent134ebe506dc37073b474a83a5c3a3ab33fa411a1 (diff)
Started on adding an "official" flag to vn<->vn relations
This is the first part. The flag is stored in the database, can be edited through the usual VN edit form, and is displayed in the diff viewer. Things to do to make this feature fully functional: - display "official" status on VN page at the relation listing - update relation graphs to display unofficial relations differently - update guidelines
Diffstat (limited to 'util/sql')
-rw-r--r--util/sql/func.sql4
-rw-r--r--util/sql/schema.sql1
2 files changed, 3 insertions, 2 deletions
diff --git a/util/sql/func.sql b/util/sql/func.sql
index 7b8b9302..922d1af8 100644
--- a/util/sql/func.sql
+++ b/util/sql/func.sql
@@ -221,7 +221,7 @@ BEGIN
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_anime SELECT aid FROM vn_anime WHERE vid = cid;
- INSERT INTO edit_vn_relations SELECT vid2, relation FROM vn_relations WHERE vid1 = 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;
END IF;
END;
@@ -239,7 +239,7 @@ BEGIN
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_anime SELECT r.cid, aid FROM edit_vn_anime;
- INSERT INTO vn_relations SELECT r.cid, vid, relation FROM edit_vn_relations;
+ 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;
UPDATE vn SET latest = r.cid WHERE id = r.iid;
RETURN r;
diff --git a/util/sql/schema.sql b/util/sql/schema.sql
index eeb2e74c..72ecd9cc 100644
--- a/util/sql/schema.sql
+++ b/util/sql/schema.sql
@@ -308,6 +308,7 @@ CREATE TABLE vn_relations (
vid1 integer NOT NULL DEFAULT 0,
vid2 integer NOT NULL DEFAULT 0,
relation vn_relation NOT NULL,
+ official boolean NOT NULL DEFAULT TRUE,
PRIMARY KEY(vid1, vid2)
);