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 -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);