diff options
author | Yorhel <git@yorhel.nl> | 2009-10-24 11:41:51 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-10-24 11:41:51 +0200 |
commit | b4bef02c08a3bc8198f97d0e97701981f9bb85c8 (patch) | |
tree | 55229b0059cf56d8f00428844416d8b8f74a1ce9 /util | |
parent | 56e691ac21163519392bb1711d173f4b52c24470 (diff) |
Removed update_rev() function and monthly revcache cron
The changes.rev column should be correct in the first place, and in the
(most likely) impossible condition that it isn't, the update_rev()
function is more likely to make things worse.
Diffstat (limited to 'util')
-rw-r--r-- | util/dump.sql | 25 | ||||
-rw-r--r-- | util/updates/update_2.8.sql | 4 |
2 files changed, 4 insertions, 25 deletions
diff --git a/util/dump.sql b/util/dump.sql index 9f8710f8..0fdf5696 100644 --- a/util/dump.sql +++ b/util/dump.sql @@ -420,31 +420,6 @@ ALTER TABLE wlists ADD FOREIGN KEY (vid) REFERENCES vn ------------------------- --- update_rev(table, ids) - updates the rev column in the changes table -CREATE FUNCTION update_rev(tbl text, ids text) RETURNS void AS $$ -DECLARE - r RECORD; - r2 RECORD; - i integer; - t text; - e text; -BEGIN - SELECT INTO t SUBSTRING(tbl, 1, 1); - e := ''; - IF ids <> '' THEN - e := ' WHERE id IN('||ids||')'; - END IF; - FOR r IN EXECUTE 'SELECT id FROM '||tbl||e LOOP - i := 1; - FOR r2 IN EXECUTE 'SELECT id FROM '||tbl||'_rev WHERE '||t||'id = '||r.id||' ORDER BY id ASC' LOOP - UPDATE changes SET rev = i WHERE id = r2.id; - i := i+1; - END LOOP; - END LOOP; -END; -$$ LANGUAGE plpgsql; - - -- update_vncache(id) - updates the c_* columns in the vn table CREATE FUNCTION update_vncache(id integer) RETURNS void AS $$ DECLARE diff --git a/util/updates/update_2.8.sql b/util/updates/update_2.8.sql index 3c1d7398..d8373210 100644 --- a/util/updates/update_2.8.sql +++ b/util/updates/update_2.8.sql @@ -207,3 +207,7 @@ END; $$ LANGUAGE plpgsql; SELECT tag_vn_calc(); + +-- remove update_rev() +DROP FUNCTION update_rev(text, text); + |