actor.usr_activity

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.

Columns

Column Type Nullable Default Notes

id PK

bigint

No

nextval('actor.usr_activity_id_seq'::regclass)

usr FK

integer

Yes

actor.usr(id)

etype FK

integer

No

config.usr_activity_type(id)

event_time

timestamp with time zone

No

now()

event_data

text

Yes

Primary Key

(id)

Foreign Keys

Column(s) References On Delete On Update Deferrable Constraint

etype

config.usr_activity_type(id)

NO ACTION

NO ACTION

No

usr_activity_etype_fkey

usr

actor.usr(id)

SET NULL

NO ACTION

No

usr_activity_usr_fkey

Indexes

Index Method Definition

usr_activity_pkey PK

btree

CREATE UNIQUE INDEX usr_activity_pkey ON actor.usr_activity USING btree (id)

usr_activity_usr_idx

btree

CREATE INDEX usr_activity_usr_idx ON actor.usr_activity USING btree (usr)

Triggers

Trigger Timing Event Level Function

remove_transient_usr_activity

BEFORE

INSERT

ROW

actor.usr_activity_transient_trg()

Trigger Bodies

remove_transient_usr_activity

Function: actor.usr_activity_transient_trg()
Timing: BEFORE INSERT ROW

This trigger modifies the row before it is written (returns a modified NEW).

BEGIN
    DELETE FROM actor.usr_activity act USING config.usr_activity_type atype
        WHERE atype.transient AND
            NEW.etype = atype.id AND
            act.etype = atype.id AND
            act.usr = NEW.usr;
    RETURN NEW;
END;