-- This sql is run to upgrade ACS3.4 News Module to the enhanced News package
--

alter table newsgroups add (        
	approval_policy varchar(20) default 'closed'
                        constraint ng_approval_policy_nn not null
                        constraint ng_approval_policy_ck
                        check ( approval_policy in ('open', 'wait','closed')),
	-- group id of the admin group for this newsgroup
        -- if null, the administrators (role) of this group will be admins
        admingroup_id   integer
                        constraint ng_admingroup_id_fk
                        references user_groups,
        enabled_p       varchar(1) default 't'
                        constraint ng_enabled_p_ck
                        check(enabled_p in ('t', 'f')),
	-- if 't', then when a member suggests an item, admin group
        -- members will be notified via e-mail
        notify_admin_p  varchar(1) default 'f'
                        constraint ng_notify_admin_p_ck
                        check(notify_admin_p in ('t', 'f'))
);


alter table news_items add (
	subtitle varchar(200)
);