]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/pgfulltext/pg_fts_install.sql
OSQA-828, Support fullname to real_name mapping from OpenID providers
[osqa.git] / forum_modules / pgfulltext / pg_fts_install.sql
index 5d5d9b84d25cbb7bdb8f19dc3c7f318658d07db5..c0468706bb5abd9707c8745fd77da20f4faa8e85 100644 (file)
@@ -116,4 +116,14 @@ begin
 end
 $$ LANGUAGE plpgsql;
 
-UPDATE forum_noderevision SET id = id WHERE TRUE;
+CREATE OR REPLACE FUNCTION public.rebuild_index() RETURNS VOID as $$
+       DECLARE
+               r integer;
+       BEGIN
+               FOR r IN SELECT active_revision_id FROM forum_node WHERE node_type = 'question' LOOP
+                       UPDATE forum_noderevision SET id = id WHERE id = r;
+               END LOOP;
+       END
+$$ LANGUAGE 'plpgsql';
+
+SELECT rebuild_index();