Index: openacs-4/packages/project-manager/sql/oracle/project-manager-notifications-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/sql/oracle/project-manager-notifications-drop.sql,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/project-manager/sql/oracle/project-manager-notifications-drop.sql 29 Apr 2005 17:43:36 -0000 1.1 +++ openacs-4/packages/project-manager/sql/oracle/project-manager-notifications-drop.sql 30 Nov 2005 06:47:36 -0000 1.1.2.1 @@ -10,83 +10,77 @@ -- Jade in turn lifted this from gwong and ben. -- -create function inline_0 () -returns integer as ' -declare - row record; begin - for row in select nt.type_id + for row in (select nt.type_id from notification_types nt - where nt.short_name in (''pm_task_notif'') + where nt.short_name in ('pm_task_notif')) loop - perform notification_type__delete(row.type_id); + notification_type.del(row.type_id); end loop; +end; +/ +show errors - return null; -end;' language 'plpgsql'; -select inline_0(); -drop function inline_0 (); - -- -- Service contract drop stuff was missing - Roberto Mello -- -create function inline_0() returns integer as ' declare - impl_id integer; v_foo integer; + v_impl_id integer; begin - -- the notification type impl - impl_id := acs_sc_impl__get_id ( - ''NotificationType'', -- impl_contract_name - ''pm_task_notif_type'' -- impl_name + v_impl_id := acs_sc_impl.get_id ( + 'NotificationType', -- impl_contract_name + 'pm_task_notif_type' -- impl_name ); - PERFORM acs_sc_binding__delete ( - ''NotificationType'', - ''pm_task_notif_type'' - ); - - v_foo := acs_sc_impl_alias__delete ( - ''NotificationType'', -- impl_contract_name - ''pm_task_notif_type'', -- impl_name - ''GetURL'' -- impl_operation_name - ); - - v_foo := acs_sc_impl_alias__delete ( - ''NotificationType'', -- impl_contract_name - ''pm_task_notif_type'', -- impl_name - ''ProcessReply'' -- impl_operation_name - ); - - select into v_foo type_id + select type_id into v_foo from notification_types - where sc_impl_id = impl_id - and short_name = ''pm_task_notif''; + where sc_impl_id = v_impl_id + and short_name = 'pm_task_notif'; - perform notification_type__delete (v_foo); - delete from notification_types_intervals where type_id = v_foo and interval_id in ( select interval_id from notification_intervals - where name in (''instant'',''hourly'',''daily'') + where name in ('instant','hourly','daily') ); delete from notification_types_del_methods where type_id = v_foo and delivery_method_id in ( select delivery_method_id from notification_delivery_methods - where short_name in (''email'') + where short_name in ('email') ); - return (0); -end; -' language 'plpgsql'; + notification_type.del (v_foo); -select inline_0(); -drop function inline_0(); + acs_sc_binding.del ( + contract_name => 'NotificationType', + impl_name => 'pm_task_notif_type' + ); + + v_foo := acs_sc_impl.delete_alias ( + 'NotificationType', -- impl_contract_name + 'pm_task_notif_type', -- impl_name + 'GetURL' -- impl_operation_name + ); + + v_foo := acs_sc_impl.delete_alias ( + 'NotificationType', -- impl_contract_name + 'pm_task_notif_type', -- impl_name + 'ProcessReply' -- impl_operation_name + ); + + acs_sc_impl.del( + 'NotificationType', + 'pm_task_notif_type' + ); + +end; +/ +show errors