Index: openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql	28 Aug 2003 09:41:58 -0000	1.12
+++ openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql	29 Jun 2004 10:18:41 -0000	1.13
@@ -236,6 +236,25 @@
 end;
 ' language 'plpgsql';
 
+select define_function_args ('notification_request__delete_all_for_user', 'user_id');
+
+create function notification_request__delete_all_for_user(integer)
+returns integer as '
+declare
+    p_user_id                       alias for $1;
+    v_request                       RECORD;
+begin
+    for v_request in select request_id
+                     from notification_requests
+                     where user_id= p_user_id
+    loop
+        perform notification_request__delete(v_request.request_id);
+    end loop;
+
+    return 0;
+end;
+' language 'plpgsql';
+
 select define_function_args ('notification__new','notification_id,type_id,object_id,notif_date,response_id,notif_user,notif_subject,notif_text,notif_html,creation_date,creation_user,creation_ip,context_id');
 
 create or replace function notification__new(integer,integer,integer,timestamptz,integer,integer,varchar,text,text,timestamptz,integer,varchar,integer)
