From 88853c1168a333c7c7b7951b2931852e6df7da55 Mon Sep 17 00:00:00 2001
From: yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>
Date: Sat, 26 Apr 2008 09:25:45 +0000
Subject: Stupid comments - like I can keep track of everything I change...

git-svn-id: svn://vndb.org/vndb@5 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
---
 util/OLD/cron_daily.sql | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 util/OLD/cron_daily.sql

(limited to 'util/OLD/cron_daily.sql')

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));
+
-- 
cgit v1.2.3

