File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ -- Drop table
2
+
3
+ -- DROP TABLE public.execution_status;
4
+
5
+ CREATE TABLE public.execution_status (
6
+ "_id" serial NOT NULL,
7
+ job_id int8 NOT NULL,
8
+ status varchar(32) NOT NULL,
9
+ details varchar NOT NULL,
10
+ update_stamp timestamp(0) NOT NULL DEFAULT now(),
11
+ CONSTRAINT execution_status_pk PRIMARY KEY (_id)
12
+ );
13
+
14
+ -- Table Triggers
15
+
16
+ create trigger last_upd_trigger before
17
+ insert
18
+ or
19
+ update
20
+ on
21
+ public.execution_status for each row execute function last_upd_trig();
22
+
23
+
24
+ --
25
+
26
+ CREATE FUNCTION last_upd_trig() RETURNS trigger
27
+ LANGUAGE plpgsql AS
28
+ $$BEGIN
29
+ NEW.lastupdate := current_timestamp;
30
+ RETURN NEW;
31
+ END;$$;
32
+
33
+ CREATE TRIGGER last_upd_trigger
34
+ BEFORE INSERT OR UPDATE ON finds
35
+ FOR EACH ROW
36
+ EXECUTE PROCEDURE last_upd_trig();
37
+
38
+
39
+
40
+
41
+
42
+ create trigger last_upd_trigger before
43
+ insert
44
+ or
45
+ update
46
+ on
47
+ public.execution_status for each row execute function last_upd_trig()
You can’t perform that action at this time.
0 commit comments