From 5f1e64aa26722623e94d11df2a5e66e9b0b670c7 Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 22 Apr 2009 13:54:23 +0000 Subject: [PATCH] add an explict name column to event definitions, unique on owner git-svn-id: svn://svn.open-ils.org/ILS/trunk@12958 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/400.schema.action_trigger.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql b/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql index 542d963ba2..ab19583633 100644 --- a/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql +++ b/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql @@ -100,6 +100,7 @@ CREATE TABLE action_trigger.event_definition ( id SERIAL PRIMARY KEY, active BOOL NOT NULL DEFAULT TRUE, owner INT NOT NULL REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED, + name TEXT NOT NULL, hook TEXT NOT NULL REFERENCES action_trigger.hook (key) DEFERRABLE INITIALLY DEFERRED, validator TEXT NOT NULL REFERENCES action_trigger.validator (module) DEFERRABLE INITIALLY DEFERRED, reactor TEXT NOT NULL REFERENCES action_trigger.reactor (module) DEFERRABLE INITIALLY DEFERRED, @@ -109,7 +110,8 @@ CREATE TABLE action_trigger.event_definition ( delay_field TEXT, -- for instance, xact_start on a circ hook ... look for fields on hook.core_type where datatype=timestamp? If not set, delay from now() group_field TEXT, -- field from this.hook.core_type to batch event targets together on, fed into reactor a group at a time. template TEXT, -- the TT block. will have an 'environment' hash (or array of hashes, grouped events) built up by validator and collector(s), which can be modified. - CONSTRAINT ev_def_owner_hook_val_react_clean_delay_once UNIQUE (owner, hook, validator, reactor, delay, delay_field) + CONSTRAINT ev_def_owner_hook_val_react_clean_delay_once UNIQUE (owner, hook, validator, reactor, delay, delay_field), + CONSTRAINT ev_def_name_owner_once UNIQUE (owner, name) ); CREATE TABLE action_trigger.environment ( -- 2.11.0