text: /*L
     Copyright Ekagra Software Technologies Ltd.
     Copyright SAIC, SAIC-Frederick
  
     Distributed under the OSI-approved BSD 3-Clause License.
     See http://ncip.github.com/common-security-module/LICENSE.txt for details.
  L*/
  
  DROP TABLE LOG;
  DROP TABLE SIGNIN_USERS
  
  CREATE TABLE LOGTAB (
  	OID NUMBER (20) NOT NULL, 
  	APPLICATION VARCHAR2(25),
  	SERVER VARCHAR2(50),
  	PRIORITY VARCHAR2(15), 
  	CATEGORY VARCHAR2(255), 
  	THREAD VARCHAR2(255), 
  	MSG VARCHAR2(4000), 
  	THROWABLE VARCHAR2(4000),
  	NDC VARCHAR(4000), 
  	CREATED_ON NUMBER(15) NOT NULL,
  	PRIMARY KEY ( OID ) );
  	
  create index OID_LOGTAB_INDX on LOGTAB(OID);
  create index APPLICATION_LOGTAB_INDX on LOGTAB(APPLICATION);
  create index SERVER_LOGTAB_INDX on LOGTAB(SERVER);
  create index PRIORITY_LOGTAB_INDX on LOGTAB(PRIORITY);
  create index THREAD_LOGTAB_INDX on LOGTAB(THREAD);
  create index CREATED_ON_LOGTAB_INDX on LOGTAB(CREATED_ON);
  
  CREATE SEQUENCE OBJECT_OID_SEQ 
  INCREMENT BY 500
  START WITH 750000
  MAXVALUE 9999999999999
  MINVALUE 750000
  NOCYCLE
  NOCACHE	
  NOORDER;
  
  CREATE OR REPLACE TRIGGER LOGTAB_OID_SEQ_TRG
  BEFORE INSERT  
  ON LOGTAB
  REFERENCING OLD AS OLD NEW AS NEW 
  FOR EACH ROW  
  BEGIN
      IF (:NEW.OID = 0 or :NEW.OID is NULL )
      THEN
  	SELECT OBJECT_OID_SEQ.NEXTVAL
  	  INTO :NEW.OID
  	  FROM DUAL;
      END IF;
  END;
  
  CREATE TABLE SIGNIN_USERS (
         USERNAME VARCHAR(255) NOT NULL,
         PASSWORD VARCHAR(255),
         PRIMARY KEY(USERNAME) );
         
  create index USERNAME_SIGNIN_USERS_INDEX on SIGNIN_USERS(USERNAME);
  create index PASSWORD_SIGNIN_USERS_PASSWORD on SIGNIN_USERS(PASSWORD);
         
  INSERT INTO signin_users (username, password) VALUES ('admin','pX4bLclVVdFwnQoyStFF3jIVAYI=');
  
  
  /