CREATE TABLE SERVER_ACCESS_PROFILE (
  ID NUMBER(10) NOT NULL, 
  IS_ACTIVE VARCHAR2(1) DEFAULT 'Y' NOT NULL, 
  CREATED DATE DEFAULT SYSDATE NOT NULL, 
  CREATED_BY NUMBER(10) NOT NULL, 
  UPDATED DATE DEFAULT SYSDATE NOT NULL, 
  UPDATED_BY NUMBER(10) NOT NULL,
  ORGANIZATION_ID NUMBER(10) NOT NULL, 
  SERVER_ID NUMBER(10) NOT NULL, 
  NRPERFILACESSO NUMBER(10) NOT NULL, 
  CONSTRAINT SRV_ACC_PROF_PK PRIMARY KEY(ID)
)
/
ALTER TABLE SERVER_ACCESS_PROFILE ADD CONSTRAINT SRV_ACC_PROF_USER FOREIGN KEY (CREATED_BY) REFERENCES ZH_USER (ID)
/
ALTER TABLE SERVER_ACCESS_PROFILE ADD CONSTRAINT SRV_ACC_PROF_USER_FK2 FOREIGN KEY (UPDATED_BY) REFERENCES ZH_USER (ID)
/
ALTER TABLE SERVER_ACCESS_PROFILE ADD CONSTRAINT SRV_ACC_PROF_SERVER_FK FOREIGN KEY (SERVER_ID) REFERENCES SERVER (ID)
/
ALTER TABLE SERVER_ACCESS_PROFILE ADD CONSTRAINT CKC_SRV_ACC_IS_ACTIVE CHECK (IS_ACTIVE IN ('Y', 'N'))
/
CREATE SEQUENCE SERVER_ACCESS_PROFILE_ID_SEQ START WITH 1 MINVALUE 1 INCREMENT BY 1
/
ALTER TABLE TASK ADD (
  IS_ORIGINAL_BASELINE VARCHAR2(1) DEFAULT NULL NULL, 
  BASELINE_OCCURRENCE VARCHAR2(20) DEFAULT NULL NULL, 
  BASELINE_OCCURRENCE_AT DATE DEFAULT NULL NULL
)
