



\encoding UTF8;



CREATE TABLE IF NOT EXISTS ALARM_INFO (
  EVENTID VARCHAR(150) NOT NULL,
  EVENTNAME VARCHAR(150) NOT NULL,
  ALARMISCLEARED SMALLINT NOT NULL,
  ROOTFLAG SMALLINT NOT NULL,
  STARTEPOCHMICROSEC BIGINT NOT NULL,
  LASTEPOCHMICROSEC BIGINT NOT NULL,
  SOURCEID VARCHAR(150)  NOT NULL,
  SOURCENAME VARCHAR(150)  NOT NULL,
  SEQUENCE SMALLINT NOT NULL,
  PRIMARY KEY (EVENTID, SEQUENCE, SOURCENAME)
);

CREATE TABLE IF NOT EXISTS ENGINE_ENTITY (
  ID VARCHAR(150) NOT NULL,
  IP VARCHAR(128) NOT NULL,
  PORT SMALLINT NOT NULL,
  LASTMODIFIED BIGINT NOT NULL,
  PRIMARY KEY (ID)
);

GRANT ALL PRIVILEGES ON ALARM_INFO TO DBUSER;
GRANT ALL PRIVILEGES ON ENGINE_ENTITY TO DBUSER;

