WIP: introduce separate database schemas #102
@ -86,7 +86,7 @@ end; $$;
|
||||
Returns the current http request as set via `basis.defineContext(...)`.
|
||||
Raises exception if not set.
|
||||
*/
|
||||
create or replace function currentRequest()
|
||||
create or replace function basis.currentRequest()
|
||||
returns text
|
||||
stable -- leakproof
|
||||
language plpgsql as $$
|
||||
|
@ -71,7 +71,7 @@ select txc.*, txj.targettable, txj.targetop, txj.targetuuid, txj.targetdelta
|
||||
/*
|
||||
Trigger function for transaction audit journal.
|
||||
*/
|
||||
create or replace function tx_journal_trigger()
|
||||
create or replace function basis.tx_journal_trigger()
|
||||
returns trigger
|
||||
language plpgsql as $$
|
||||
declare
|
||||
@ -84,7 +84,7 @@ begin
|
||||
insert
|
||||
into tx_context (txId, txTimestamp, currentUser, assumedRoles, currentTask, currentRequest)
|
||||
values ( curTxId, now(),
|
||||
currentUser(), assumedRoles(), curTask, currentRequest())
|
||||
currentUser(), assumedRoles(), curTask, basis.currentRequest())
|
||||
on conflict do nothing;
|
||||
|
||||
case tg_op
|
||||
@ -125,7 +125,7 @@ begin
|
||||
|
||||
createTriggerSQL = 'CREATE TRIGGER ' || targetTable || '_journal' ||
|
||||
' AFTER INSERT OR UPDATE OR DELETE ON ' || targetTable ||
|
||||
' FOR EACH ROW EXECUTE PROCEDURE tx_journal_trigger()';
|
||||
' FOR EACH ROW EXECUTE PROCEDURE basis.tx_journal_trigger()';
|
||||
execute createTriggerSQL;
|
||||
end; $$;
|
||||
--//
|
||||
|
Loading…
Reference in New Issue
Block a user