Project

General

Profile

1
/*
2
 * scheduled_job -- table to store scheduled jobs
3
 */
4
CREATE SEQUENCE scheduled_job_id_seq;
5
CREATE TABLE scheduled_job (
6
  id INT8 NOT NULL default nextval('scheduled_job_id_seq'),
7
  date_created TIMESTAMP NOT NULL,
8
  date_updated TIMESTAMP NOT NULL,
9
  status VARCHAR(64) NOT NULL,
10
  name VARCHAR(512) NOT NULL,
11
  trigger_name VARCHAR(512) NOT NULL,
12
  group_name VARCHAR(512) NOT NULL,
13
  class_name VARCHAR(1024) NOT NULL,
14
  start_time TIMESTAMP NOT NULL,
15
  interval_value INT NOT NULL,
16
  interval_unit VARCHAR(8) NOT NULL,
17
  CONSTRAINT scheduled_job_pk PRIMARY KEY (id),
18
  CONSTRAINT scheduled_job_uk UNIQUE (name)
19
);
20

    
21
/*
22
 * scheduled_job_params -- table to store scheduled job parameters
23
 */
24
CREATE SEQUENCE scheduled_job_params_id_seq;
25
CREATE TABLE scheduled_job_params (
26
  id INT8  NOT NULL default nextval('scheduled_job_params_id_seq'),
27
  date_created TIMESTAMP NOT NULL,
28
  date_updated TIMESTAMP  NOT NULL,
29
  status VARCHAR(64)  NOT NULL,
30
  job_id INT8 NOT NULL,
31
  key VARCHAR(64) NOT NULL,
32
  value VARCHAR(1024) NOT NULL,
33
  CONSTRAINT scheduled_job_params_pk PRIMARY KEY (id),
34
  CONSTRAINT scheduled_job_params_fk
35
        FOREIGN KEY (job_id) REFERENCES scheduled_job(id)
36
);
37

    
38

    
39
/*
40
 * update the database version
41
 */
42
UPDATE db_version SET status=0;
43

    
44
INSERT INTO db_version (version, status, date_created) 
45
  VALUES ('1.9.2', 1, CURRENT_DATE);
(41-41/46)