1-- SCHEDULE_ACTIVITIES
 2CREATE TABLE schedule_activities (
 3        sensing_time timestamp NOT NULL,
 4        sid_num smallint NOT NULL,
 5        internal_id varchar(40) NOT NULL,
 6        name varchar(40) NOT NULL,
 7        proc_id varchar(40),
 8        ssid varchar(40),
 9        type varchar(20) NOT NULL,
10        class varchar(20) NOT NULL,
11        execution_time timestamp,
12        trigger_time timestamp,
13        abs_orbit bigint NOT NULL,
14        pso double precision NOT NULL,
15        final_status varchar(20) NOT NULL,
16        actions jsonb,
17        parameters jsonb
18);
19ALTER TABLE schedule_activities ADD CONSTRAINT schedule_activity_pk PRIMARY KEY (sid_num,sensing_time,internal_id);
20
21
22-- SCHEDULE_TML_ACTIONS
23CREATE TABLE schedule_tml_actions (
24        sensing_time timestamp NOT NULL,
25        sid_num smallint NOT NULL,
26        message varchar(1048) NOT NULL,
27        status varchar(20) NOT NULL
28);
29ALTER TABLE schedule_tml_actions ADD CONSTRAINT schedule_tml_actions_c PRIMARY KEY (sid_num,sensing_time);