--
-- enqueue_forums/0
--
create or replace function enqueue_forums(
  
) returns int4 as $$

declare v_message_row record;
begin
for v_message_row in
select message_id from forums_messages
where forum_id in
(select forum_id from forums_forums
where enabled_p='t')
loop
perform search_observer__enqueue(v_message_row.message_id,'INSERT');
end loop;

return 0;
end;$$ language plpgsql;