Create a new trigger - postgres docs
Arguments:
table_name
[Name] - name of the table where the new trigger will livetrigger_name
[Name] - name of the new triggertrigger_options
[object] - options:when
[string] -BEFORE
,AFTER
, orINSTEAD OF
operation
[string or array of strings] -INSERT
,UPDATE[ OF ...]
,DELETE
orTRUNCATE
constraint
[boolean] - creates constraint triggerfunction
[Name] - the name of procedure to executefunctionArgs
[array] - parameters of the procedurelevel
[string] -STATEMENT
, orROW
condition
[string] - condition to met to execute triggerdeferrable
[boolean] - flag for deferrable constraint triggerdeferred
[boolean] - flag for initially deferred deferrable constraint trigger
definition
[string] - optional definition of function which will be created with same name as trigger
Reverse Operation: dropTrigger
Drop a trigger - postgres docs
Arguments:
table_name
[Name] - name of the table where the trigger livestrigger_name
[Name] - name of the trigger to dropdrop_options
[object] - options:ifExists
[boolean] - drops trigger only if it existscascade
[boolean] - drops also dependent objects
Rename a trigger - postgres docs
Arguments: