From b4bef02c08a3bc8198f97d0e97701981f9bb85c8 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sat, 24 Oct 2009 11:41:51 +0200 Subject: 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. --- util/dump.sql | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'util/dump.sql') 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 -- cgit v1.2.3