Index: openacs-4/packages/notifications/notifications.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/notifications.info,v diff -u -N -r1.58 -r1.59 --- openacs-4/packages/notifications/notifications.info 31 May 2018 10:54:19 -0000 1.58 +++ openacs-4/packages/notifications/notifications.info 3 Oct 2018 09:11:50 -0000 1.59 @@ -8,7 +8,7 @@ t notifications - + OpenACS Email notifications management 2017-08-06 @@ -17,7 +17,7 @@ 3 #notifications.Notifications# - + Index: openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql 7 Aug 2017 23:48:13 -0000 1.16 +++ openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql 3 Oct 2018 09:11:50 -0000 1.17 @@ -109,16 +109,10 @@ interval_id integer constraint notif_request_interv_id_nn not null, - constraint notif_request_interv_fk - foreign key (type_id, interval_id) - references notification_types_intervals (type_id, interval_id), -- the delivery method must be allowed for this type delivery_method_id integer constraint notif_request_delivery_meth_nn not null, - constraint notif_request_deliv_fk - foreign key (type_id, delivery_method_id) - references notification_types_del_methods (type_id, delivery_method_id), -- the format of the notification should be... format varchar(100) default 'text' @@ -127,7 +121,15 @@ dynamic_p char(1) default 'f' constraint notif_request_dynamic_ch - check (dynamic_p in ('t', 'f')) + check (dynamic_p in ('t', 'f')), + constraint notif_request_interv_fk + foreign key (type_id, interval_id) + references notification_types_intervals (type_id, interval_id), + constraint notif_request_deliv_fk + foreign key (type_id, delivery_method_id) + references notification_types_del_methods (type_id, delivery_method_id), + constraint notification_requests_un + unique (type_id, user_id, object_id) ); create index notification_requests_t_o_idx on notification_requests(type_id, object_id); Index: openacs-4/packages/notifications/sql/oracle/upgrade/upgrade-5.10.0d2-5.10.0d3.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/oracle/upgrade/upgrade-5.10.0d2-5.10.0d3.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/notifications/sql/oracle/upgrade/upgrade-5.10.0d2-5.10.0d3.sql 3 Oct 2018 09:11:50 -0000 1.1 @@ -0,0 +1,4 @@ + +ALTER TABLE notification_requests +ADD CONSTRAINT notification_requests_un +UNIQUE (type_id, user_id, object_id); Index: openacs-4/packages/notifications/sql/postgresql/notifications-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/notifications-core-create.sql,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/notifications/sql/postgresql/notifications-core-create.sql 7 Jun 2008 20:29:00 -0000 1.16 +++ openacs-4/packages/notifications/sql/postgresql/notifications-core-create.sql 3 Oct 2018 09:11:50 -0000 1.17 @@ -120,22 +120,24 @@ interval_id integer constraint notifications_request_interv_id_nn not null, - constraint notifications_request_interv_fk - foreign key (type_id, interval_id) - references notification_types_intervals (type_id, interval_id), -- the delivery method must be allowed for this type delivery_method_id integer constraint notifications_request_delivery_meth_nn not null, - constraint notifications_request_deliv_fk - foreign key (type_id, delivery_method_id) - references notification_types_del_methods (type_id, delivery_method_id), -- the format of the notification should be... format varchar(100) default 'text' constraint notifications_request_format_ck check (format in ('text', 'html')), - dynamic_p bool default 'f' + dynamic_p bool default 'f', + constraint notifications_request_interv_fk + foreign key (type_id, interval_id) + references notification_types_intervals (type_id, interval_id), + constraint notifications_request_deliv_fk + foreign key (type_id, delivery_method_id) + references notification_types_del_methods (type_id, delivery_method_id), + constraint notification_requests_un + unique (type_id, user_id, object_id) ); create index notification_requests_t_o_idx on notification_requests(type_id, object_id); Index: openacs-4/packages/notifications/sql/postgresql/upgrade/upgrade-5.10.0d2-5.10.0d3.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/upgrade/upgrade-5.10.0d2-5.10.0d3.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/notifications/sql/postgresql/upgrade/upgrade-5.10.0d2-5.10.0d3.sql 3 Oct 2018 09:11:50 -0000 1.1 @@ -0,0 +1,4 @@ + +ALTER TABLE notification_requests +ADD CONSTRAINT notification_requests_un +UNIQUE (type_id, user_id, object_id);