X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/c76406e46e71cb86cfb440667bfbbe21b36e709e..15eabbf86190e4bc8ae9dc747d853b0300976b12:/forum_modules/pgfulltext/pg_fts_install.sql 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();