summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-12-21 10:37:54 +0100
committerYorhel <git@yorhel.nl>2010-12-21 10:37:54 +0100
commit19e353c480091ec607324ee09a8821dd3d895975 (patch)
tree5cf8567f728e5539954d5b2e89ca25bbe4752350 /util
parentd9aebf063c8ba2b6368418f9b9cab1fbbf241582 (diff)
Added notes field to the user VN list
The interface to set this could be more dynamic, since it'll be a lot of work to set different notes for each VN. But oh well, let's first see how many people will use this feature.
Diffstat (limited to 'util')
-rw-r--r--util/sql/schema.sql1
-rw-r--r--util/updates/update_2.16.sql3
2 files changed, 3 insertions, 1 deletions
diff --git a/util/sql/schema.sql b/util/sql/schema.sql
index a68a901d..eff5edde 100644
--- a/util/sql/schema.sql
+++ b/util/sql/schema.sql
@@ -346,6 +346,7 @@ CREATE TABLE vnlists (
vid integer NOT NULL,
status smallint NOT NULL DEFAULT 0,
added TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+ notes varchar NOT NULL DEFAULT '',
PRIMARY KEY(uid, vid)
);
diff --git a/util/updates/update_2.16.sql b/util/updates/update_2.16.sql
index 07050734..9ff96b32 100644
--- a/util/updates/update_2.16.sql
+++ b/util/updates/update_2.16.sql
@@ -15,6 +15,7 @@ CREATE TABLE vnlists (
vid integer NOT NULL REFERENCES vn (id),
status smallint NOT NULL DEFAULT 0,
added TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+ notes varchar NOT NULL DEFAULT '',
PRIMARY KEY(uid, vid)
);
@@ -24,7 +25,7 @@ CREATE TABLE vnlists (
-- convert from rlists.vstat
-INSERT INTO vnlists SELECT
+INSERT INTO vnlists (uid, vid, status, added) SELECT
i.uid, i.vid, COALESCE(MIN(CASE WHEN rl.vstat = 0 THEN NULL ELSE rl.vstat END), 0), MIN(rl.added)
FROM (
SELECT DISTINCT rl.uid, rv.vid