actor.org_unit_setting
Org Unit settings
This table contains any arbitrary settings that a client program would like to save for an org unit.
|
Data-Modifying Triggers: This table has BEFORE ROW trigger(s) that modify row data before write. Values you INSERT or UPDATE may differ from what is actually stored. See the Triggers section below. |
|
Cascading Deletes: Deleting rows from this table will cascade to: actor.org_unit. |
|
Deferrable Constraints: The following FK constraints are deferrable — they are checked at transaction end, not statement end: |
|
Trigger Side Effects: Writing to this table automatically triggers writes to other tables:
|
Columns
| Column | Type | Nullable | Default | Notes |
|---|---|---|---|---|
id PK |
|
No |
nextval('actor.org_unit_setting_id_seq'::regclass) |
|
org_unit FK |
|
No |
||
name FK |
|
No |
||
value |
|
No |
Foreign Keys
| Column(s) | References | On Delete | On Update | Deferrable | Constraint |
|---|---|---|---|---|---|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
CASCADE |
NO ACTION |
DEFERRED |
|
Indexes
| Index | Method | Definition |
|---|---|---|
|
btree |
|
|
btree |
|
|
btree |
|
Triggers
| Trigger | Timing | Event | Level | Function |
|---|---|---|---|---|
|
BEFORE |
INSERT OR UPDATE |
ROW |
|
|
BEFORE |
DELETE |
ROW |
Trigger Bodies
log_ous_change
Function: evergreen.ous_change_log()
Timing: BEFORE INSERT OR UPDATE ROW
|
This trigger modifies the row before it is written (returns a modified |
DECLARE
original TEXT;
BEGIN
-- Check for which setting is being updated, and log it.
SELECT INTO original value FROM actor.org_unit_setting WHERE name = NEW.name AND org_unit = NEW.org_unit;
INSERT INTO config.org_unit_setting_type_log (org,original_value,new_value,field_name) VALUES (NEW.org_unit, original, NEW.value, NEW.name);
RETURN NEW;
END;
log_ous_del
Function: evergreen.ous_delete_log()
Timing: BEFORE DELETE ROW
DECLARE
original TEXT;
BEGIN
-- Check for which setting is being updated, and log it.
SELECT INTO original value FROM actor.org_unit_setting WHERE name = OLD.name AND org_unit = OLD.org_unit;
INSERT INTO config.org_unit_setting_type_log (org,original_value,new_value,field_name) VALUES (OLD.org_unit, original, 'null', OLD.name);
RETURN OLD;
END;