X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/c76406e46e71cb86cfb440667bfbbe21b36e709e..9162dea1adb758b31ab40323d28ca585ed667eaf:/forum_modules/pgfulltext/pg_fts_install.sql?ds=sidebyside

diff --git a/forum_modules/pgfulltext/pg_fts_install.sql b/forum_modules/pgfulltext/pg_fts_install.sql
index e08e22b..c046870 100644
--- a/forum_modules/pgfulltext/pg_fts_install.sql
+++ b/forum_modules/pgfulltext/pg_fts_install.sql
@@ -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();
