File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ create
2+ or replace function orb .set_updated_at () returns trigger language plpgsql as $$
3+ begin
4+ new .updated_at = now();
5+ return NEW;
6+ end;
7+ $$;
8+
9+ alter function orb .set_updated_at () owner to postgres;
10+
11+ alter table orb .subscriptions
12+ add updated_at timestamptz default timezone (' utc' ::text , now()) not null ;
13+
14+ create trigger handle_updated_at before
15+ update on orb .subscriptions for each row
16+ execute function orb .set_updated_at ();
17+
18+ alter table orb .customers
19+ add updated_at timestamptz default timezone (' utc' ::text , now()) not null ;
20+
21+ create trigger handle_updated_at before
22+ update on orb .customers for each row
23+ execute function orb .set_updated_at ();
24+
25+ alter table orb .invoices
26+ add updated_at timestamptz default timezone (' utc' ::text , now()) not null ;
27+
28+ create trigger handle_updated_at before
29+ update on orb .invoices for each row
30+ execute function orb .set_updated_at ();
31+
32+ alter table orb .credit_notes
33+ add updated_at timestamptz default timezone (' utc' ::text , now()) not null ;
34+
35+ create trigger handle_updated_at before
36+ update on orb .credit_notes for each row
37+ execute function orb .set_updated_at ();
You can’t perform that action at this time.
0 commit comments