Project

General

Profile

metacat / src / upgrade-db-to-1.9.2-postgres.sql @ 8556

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
  end_time TIMESTAMP,
16
  interval_value INT NOT NULL,
17
  interval_unit VARCHAR(8) NOT NULL,
18
  CONSTRAINT scheduled_job_pk PRIMARY KEY (id),
19
  CONSTRAINT scheduled_job_uk UNIQUE (name)
20
);
21

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

    
39

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

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