Subversion Repositories XServices

Rev

Rev 201 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
201 brianR 1
-- Create Schema for Brutex
2
CREATE SCHEMA IF NOT EXISTS brutex;
3
 
4
CREATE TABLE IF NOT EXISTS brutex.tbl_events
5
            (
6
            btx_event_type VARCHAR(128) NOT NULL,
203 brianR 7
            btx_id VARCHAR(128) NOT NULL,
201 brianR 8
            btx_obj_type VARCHAR(32) NOT NULL,
9
            btx_obj_id VARCHAR(32) NOT NULL,
10
            btx_timestamp BIGINT NOT NULL,
11
            btx_event CLOB
12
            );
13
CREATE INDEX IF NOT EXISTS brutex.btx_idx_key ON brutex.tbl_events (btx_obj_id, btx_obj_type, btx_event_type);
14
CREATE INDEX IF NOT EXISTS brutex.btx_idx_ts ON brutex.tbl_events (btx_timestamp ASC);
203 brianR 15
CREATE INDEX IF NOT EXISTS brutex.btx_idx_id ON brutex.tbl_events (btx_id);
201 brianR 16
 
17
 
18
CREATE TABLE IF NOT EXISTS brutex.tbl_events_snap
19
(
20
    btx_event_type VARCHAR(128) NOT NULL,
203 brianR 21
    btx_id VARCHAR(128) NOT NULL,
201 brianR 22
    btx_obj_type VARCHAR(32) NOT NULL,
23
    btx_obj_id VARCHAR(32) NOT NULL,
24
    btx_timestamp BIGINT NOT NULL,
25
    btx_run BIGINT NOT NULL,
26
    btx_event CLOB
27
);
28
 
29
CREATE INDEX IF NOT EXISTS brutex.btx_idx_ts ON brutex.tbl_events_snap (btx_timestamp ASC);
30
 
31
CREATE TABLE IF NOT EXISTS brutex.tbl_events_errors
32
(
33
    btx_event_type VARCHAR(128) NOT NULL,
203 brianR 34
    btx_id VARCHAR(128) NOT NULL,
201 brianR 35
    btx_obj_type VARCHAR(32) NOT NULL,
36
    btx_obj_id VARCHAR(32) NOT NULL,
37
    btx_timestamp BIGINT NOT NULL,
38
    btx_retry BOOL,
39
    btx_response CLOB,
40
    btx_event CLOB
41
);
42
CREATE INDEX IF NOT EXISTS brutex.btx_idx_ts ON brutex.tbl_events_errors (btx_timestamp ASC);
43
CREATE INDEX IF NOT EXISTS brutex.btx_idx_retry ON brutex.tbl_events_errors (btx_retry);
203 brianR 44
 
45
CREATE TABLE IF NOT EXISTS brutex.tbl_events_all
46
(
47
    btx_event_type VARCHAR(128) NOT NULL,
48
    btx_id VARCHAR(128) NOT NULL,
49
    btx_obj_type VARCHAR(32) NOT NULL,
50
    btx_obj_id VARCHAR(32) NOT NULL,
51
    btx_timestamp BIGINT NOT NULL,
52
    btx_supersed_id VARCHAR(128),
53
    btx_event CLOB
54
);
55
 
56
CREATE INDEX IF NOT EXISTS brutex.btx_idx_ssed ON brutex.tbl_events_all (btx_supersed_id);
57
CREATE INDEX IF NOT EXISTS brutex.btx_idx_ts ON brutex.tbl_events_all (btx_timestamp ASC);