Subversion Repositories XServices

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

-- Create Schema for Brutex
CREATE SCHEMA IF NOT EXISTS brutex;

CREATE TABLE IF NOT EXISTS brutex.tbl_events
            (
            btx_event_type VARCHAR(128) NOT NULL,
            btx_id VARCHAR(32) NOT NULL,
            btx_obj_type VARCHAR(32) NOT NULL,
            btx_obj_id VARCHAR(32) NOT NULL,
            btx_timestamp BIGINT NOT NULL,
            btx_event CLOB
            );
CREATE INDEX IF NOT EXISTS brutex.btx_idx_key ON brutex.tbl_events (btx_obj_id, btx_obj_type, btx_event_type);
CREATE INDEX IF NOT EXISTS brutex.btx_idx_ts ON brutex.tbl_events (btx_timestamp ASC);


CREATE TABLE IF NOT EXISTS brutex.tbl_events_snap
(
    btx_event_type VARCHAR(128) NOT NULL,
    btx_id VARCHAR(32) NOT NULL,
    btx_obj_type VARCHAR(32) NOT NULL,
    btx_obj_id VARCHAR(32) NOT NULL,
    btx_timestamp BIGINT NOT NULL,
    btx_run BIGINT NOT NULL,
    btx_event CLOB
);

CREATE INDEX IF NOT EXISTS brutex.btx_idx_ts ON brutex.tbl_events_snap (btx_timestamp ASC);

CREATE TABLE IF NOT EXISTS brutex.tbl_events_errors
(
    btx_event_type VARCHAR(128) NOT NULL,
    btx_id VARCHAR(32) NOT NULL,
    btx_obj_type VARCHAR(32) NOT NULL,
    btx_obj_id VARCHAR(32) NOT NULL,
    btx_timestamp BIGINT NOT NULL,
    btx_retry BOOL,
    btx_response CLOB,
    btx_event CLOB
);
CREATE INDEX IF NOT EXISTS brutex.btx_idx_ts ON brutex.tbl_events_errors (btx_timestamp ASC);
CREATE INDEX IF NOT EXISTS brutex.btx_idx_retry ON brutex.tbl_events_errors (btx_retry);