action_trigger.event
|
Deferrable Constraints: The following FK constraints are deferrable — they are checked at transaction end, not statement end: |
Columns
| Column | Type | Nullable | Default | Notes |
|---|---|---|---|---|
id PK |
|
No |
nextval('action_trigger.event_id_seq'::regclass) |
|
target |
|
No |
||
event_def FK |
|
Yes |
||
add_time |
|
No |
now() |
|
run_time |
|
No |
||
start_time |
|
Yes |
||
update_time |
|
Yes |
||
complete_time |
|
Yes |
||
update_process |
|
Yes |
||
state |
|
No |
'pending'::text |
|
user_data |
|
Yes |
||
template_output FK |
|
Yes |
||
error_output FK |
|
Yes |
||
async_output FK |
|
Yes |
||
context_user FK |
|
Yes |
||
context_library FK |
|
Yes |
||
context_bib FK |
|
Yes |
||
context_item |
|
Yes |
Foreign Keys
| Column(s) | References | On Delete | On Update | Deferrable | Constraint |
|---|---|---|---|---|---|
|
NO ACTION |
NO ACTION |
No |
|
|
|
NO ACTION |
NO ACTION |
No |
|
|
|
NO ACTION |
NO ACTION |
No |
|
|
|
NO ACTION |
NO ACTION |
No |
|
|
|
NO ACTION |
NO ACTION |
No |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
No |
|
Check Constraints
-
event_state_check:CHECK state = ANY (ARRAY['pending'::text, 'invalid'::text, 'found'::text, 'collecting'::text, 'collected'::text, 'validating'::text, 'valid'::text, 'reacting'::text, 'reacted'::text, 'cleaning'::text, 'complete'::text, 'error'::text]) -
event_user_data_check:CHECK
Indexes
| Index | Method | Definition |
|---|---|---|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
Triggers
| Trigger | Timing | Event | Level | Function |
|---|---|---|---|---|
|
AFTER |
INSERT OR UPDATE |
ROW |
Trigger Bodies
action_trigger_event_context_item_fkey_trig
Function: evergreen.fake_fkey_tgr()
Timing: AFTER INSERT OR UPDATE ROW
DECLARE
copy_id BIGINT;
BEGIN
EXECUTE 'SELECT ($1).' || quote_ident(TG_ARGV[0]) INTO copy_id USING NEW;
IF copy_id IS NOT NULL THEN
PERFORM * FROM asset.copy WHERE id = copy_id;
IF NOT FOUND THEN
RAISE EXCEPTION 'Key (%.%=%) does not exist in asset.copy', TG_TABLE_SCHEMA, TG_TABLE_NAME, copy_id;
END IF;
END IF;
RETURN NULL;
END;