1 DROP SCHEMA reporter CASCADE;
3 CREATE SCHEMA reporter;
7 CREATE TABLE reporter.stage2 (
14 create_date timestamp with time zone not null
16 edit_date timestamp with time zone not null
20 CREATE OR REPLACE FUNCTION reporter.force_edit_date_update () RETURNS TRIGGER AS $$
22 NEW.edit_date = NOW();
27 CREATE TRIGGER force_edit_date_update_trig
28 BEFORE UPDATE ON reporter.stage2
30 EXECUTE PROCEDURE reporter.force_edit_date_update ();
32 CREATE TABLE reporter.stage3 (
33 id serial primary key,
35 references reporter.stage2 (id)
43 create_date timestamp with time zone not null
45 runtime timestamp with time zone default now(),
49 CREATE TABLE reporter.output (
50 id serial primary key,
52 references reporter.stage3 (id)
56 queue_time timestamp with time zone not null default now(),
57 run_time timestamp with time zone,
61 error_time timestamp with time zone,
62 complete_time timestamp with time zone,
63 state text check (state in ('wait','running','complete','error'))