]> 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 e08e22b72a6567d3a2df466afa4e7901c3bcac68..c0468706bb5abd9707c8745fd77da20f4faa8e85 100644 (file)
@@ -116,5 +116,14 @@ begin
 end
 $$ LANGUAGE plpgsql;
 
-ALTER table forum_rootnode_doc DISABLE TRIGGER ALL;
-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();