summaryrefslogtreecommitdiff
path: root/util/OLD/cron_daily.sql
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-04-26 09:25:45 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-04-26 09:25:45 +0000
commit88853c1168a333c7c7b7951b2931852e6df7da55 (patch)
treefbad6f17f0820c89ce5dd8da748cf37b56549d14 /util/OLD/cron_daily.sql
parentd2efb163c11a11e02abd7251fdfde3cb54c710ef (diff)
Stupid comments - like I can keep track of everything I change...
git-svn-id: svn://vndb.org/vndb@5 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'util/OLD/cron_daily.sql')
-rw-r--r--util/OLD/cron_daily.sql15
1 files changed, 15 insertions, 0 deletions
diff --git a/util/OLD/cron_daily.sql b/util/OLD/cron_daily.sql
new file mode 100644
index 00000000..c30f30f1
--- /dev/null
+++ b/util/OLD/cron_daily.sql
@@ -0,0 +1,15 @@
+-- update c_* columns in vn
+SELECT update_vncache(0), calculate_rating();
+
+-- update changes.prev columns
+SELECT update_prev('vn', ''), update_prev('releases', ''), update_prev('producers', '');
+
+-- check...
+ SELECT 'r', id FROM releases_rev rr
+ WHERE NOT EXISTS(SELECT 1 FROM releases_vn rv WHERE rr.id = rv.rid)
+UNION
+ SELECT c.type::varchar, id FROM changes c
+ WHERE (c.type = 0 AND NOT EXISTS(SELECT 1 FROM vn_rev vr WHERE vr.id = c.id))
+ OR (c.type = 1 AND NOT EXISTS(SELECT 1 FROM releases_rev rr WHERE rr.id = c.id))
+ OR (c.type = 2 AND NOT EXISTS(SELECT 1 FROM producers_rev pr WHERE pr.id = c.id));
+