asset.copy_alert

Cascading Deletes: Deleting rows from this table will cascade to: config.copy_alert_type.

Columns

Column Type Nullable Default Notes

id PK

bigint

No

nextval('asset.copy_alert_id_seq'::regclass)

alert_type FK

integer

No

config.copy_alert_type(id)

copy

bigint

No

temp

boolean

No

false

create_time

timestamp with time zone

No

now()

create_staff FK

bigint

No

actor.usr(id)

note

text

Yes

ack_time

timestamp with time zone

Yes

ack_staff FK

bigint

Yes

actor.usr(id)

Primary Key

(id)

Foreign Keys

Column(s) References On Delete On Update Deferrable Constraint

ack_staff

actor.usr(id)

SET NULL

NO ACTION

No

copy_alert_ack_staff_fkey

alert_type

config.copy_alert_type(id)

CASCADE

NO ACTION

No

copy_alert_alert_type_fkey

create_staff

actor.usr(id)

SET NULL

NO ACTION

No

copy_alert_create_staff_fkey

Indexes

Index Method Definition

copy_alert_pkey PK

btree

CREATE UNIQUE INDEX copy_alert_pkey ON asset.copy_alert USING btree (id)

Triggers

Trigger Timing Event Level Function

inherit_asset_copy_alert_copy_fkey

AFTER

INSERT OR UPDATE

ROW

evergreen.asset_copy_alert_copy_inh_fkey()

Trigger Bodies

inherit_asset_copy_alert_copy_fkey

Function: evergreen.asset_copy_alert_copy_inh_fkey()
Timing: AFTER INSERT OR UPDATE ROW

BEGIN
        PERFORM 1 FROM asset.copy WHERE id = NEW.copy;
        IF NOT FOUND THEN
                RAISE foreign_key_violation USING MESSAGE = FORMAT(
                        $$Referenced asset.copy id not found, copy:%s$$, NEW.copy
                );
        END IF;
        RETURN NEW;
END;