summaryrefslogtreecommitdiff
path: root/lib/Multi/Feed.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-10-21 13:10:19 +0200
committerYorhel <git@yorhel.nl>2015-10-21 13:10:46 +0200
commit08a0d819efd244c8b3dacfd810b7322ad8df73fb (patch)
tree06847acc034e71a349f32cbe18bd47a0925cf505 /lib/Multi/Feed.pm
parent9cf3eef0e0a7bde10a0e1bb8c94c38b058e5121d (diff)
SQL: Fix Multi to use the new DB schema
That should be the last thing to convert to the new schema.
Diffstat (limited to 'lib/Multi/Feed.pm')
-rw-r--r--lib/Multi/Feed.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Multi/Feed.pm b/lib/Multi/Feed.pm
index d2161aec..2c4144db 100644
--- a/lib/Multi/Feed.pm
+++ b/lib/Multi/Feed.pm
@@ -44,16 +44,16 @@ sub generate {
# changes
pg_cmd q{
- SELECT '/'||c.type||COALESCE(vr.vid, rr.rid, pr.pid, cr.cid, sr.sid)||'.'||c.rev AS id,
- COALESCE(vr.title, rr.title, pr.name, cr.name, sa.name) AS title, extract('epoch' from c.added) AS updated,
+ SELECT '/'||c.type||COALESCE(v.id, r.id, p.id, c.id, s.id)||'.'||c.rev AS id,
+ COALESCE(v.title, r.title, p.name, ca.name, sa.name) AS title, extract('epoch' from c.added) AS updated,
u.username, u.id AS uid, c.comments AS summary
FROM changes c
- LEFT JOIN vn_rev vr ON c.type = 'v' AND c.id = vr.id
- LEFT JOIN releases_rev rr ON c.type = 'r' AND c.id = rr.id
- LEFT JOIN producers_rev pr ON c.type = 'p' AND c.id = pr.id
- LEFT JOIN chars_rev cr ON c.type = 'c' AND c.id = cr.id
- LEFT JOIN staff_rev sr ON c.type = 's' AND c.id = sr.id
- LEFT JOIN staff_alias sa ON sa.rid = sr.id AND sa.id = sr.aid
+ LEFT JOIN vn v ON c.type = 'v' AND c.itemid = v.id
+ LEFT JOIN releases r ON c.type = 'r' AND c.itemid = r.id
+ LEFT JOIN producers p ON c.type = 'p' AND c.itemid = p.id
+ LEFT JOIN chars ca ON c.type = 'c' AND c.itemid = ca.id
+ LEFT JOIN staff s ON c.type = 's' AND c.itemid = s.id
+ LEFT JOIN staff_alias sa ON sa.id = s.id AND sa.aid = s.aid
JOIN users u ON u.id = c.requester
WHERE c.requester <> 1
ORDER BY c.id DESC