X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/178a88bfeb53a6b9520c74c10eea42073098902b..edcd42cff2f41ebea0f49df0390a17886d32bd38:/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 5d5d9b8..c046870 100644 --- a/forum_modules/pgfulltext/pg_fts_install.sql +++ b/forum_modules/pgfulltext/pg_fts_install.sql @@ -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();