Forum OpenACS Development: Re: Notification intervals -- adding more like openacs.org?

Actually, it's trivial to add an upgrade script to do this if you want a site to have more notification intervals, so there's no need to modify the existing notification, file-storage, or forum packages (though it would make some sense to have this install out of the box):

-- notification-intervals-update.sql

-- add missing notification intervals

select notification_interval__new (
    null,
    'weekly',
    3600 * 24 * 7,
    now(),
    null,
    null,
    null
);

select notification_interval__new (
    null,
    'every other day',
    3600 * 24 * 2,
    now(),
    null,
    null,
    null
);

-- add in missing intervals to any client package types

create function inline_0() returns integer as '
declare
        v_type_id integer;
begin
        insert into notification_types_intervals
        (type_id, interval_id)
        select t.type_id, i.interval_id 
        from notification_types t, notification_intervals i where i.name in (''weekly'',''qod'');

	return (0);
end;
' language 'plpgsql';

select inline_0();
drop function inline_0();