DROP TABLE HRIS_APPRAISAL_ANSWER;
DROP TABLE HRIS_APPRAISAL_ASSIGN;
DROP TABLE HRIS_APPRAISAL_COMPETENCY;
DROP TABLE HRIS_APPRAISAL_DEFAULT;
DROP TABLE HRIS_APPRAISAL_HEADING;
DROP TABLE HRIS_APPRAISAL_KPI;
DROP TABLE HRIS_APPRAISAL_QUESTION;
DROP TABLE HRIS_APPRAISAL_QUESTION_OPTS;
DROP TABLE HRIS_APPRAISAL_SETUP;
DROP TABLE HRIS_APPRAISAL_STAGE;
DROP TABLE HRIS_APPRAISAL_STAGE_QUESTIONS;
DROP TABLE HRIS_APPRAISAL_STATUS;
DROP TABLE HRIS_APPRAISAL_TYPE;
DROP TABLE HR_APPRAISAL_CODE;
DROP TABLE HR_APPRAISAL_DETAIL;
DROP TABLE HR_APPRAISAL_DETAIL_CODE;

CREATE TABLE "HRIS_APPRAISAL_TYPE"
  (
    "APPRAISAL_TYPE_ID"    NUMBER(7,0),
    "APPRAISAL_TYPE_CODE"  VARCHAR2(15 BYTE),
    "APPRAISAL_TYPE_EDESC" VARCHAR2(100 BYTE),
    "APPRAISAL_TYPE_NDESC" VARCHAR2(400 BYTE) DEFAULT NULL,
    "COMPANY_ID"           NUMBER(7,0),
    "BRANCH_ID"            NUMBER(7,0),
    "CREATED_BY"           NUMBER(7,0),
    "CREATED_DATE"         DATE DEFAULT SYSDATE,
    "MODIFIED_BY"          NUMBER(7,0),
    "MODIFIED_DATE"        DATE,
    "CHECKED"              VARCHAR2(1 BYTE) DEFAULT 'N',
    "APPROVED_BY"          NUMBER(7,0),
    "APPROVED_DATE"        DATE DEFAULT SYSDATE,
    "APPROVED"             VARCHAR2(1 BYTE) DEFAULT 'N',
    "STATUS"               CHAR(1 BYTE),
    "REMARKS"              VARCHAR2(255 BYTE)
  ) ;
CREATE TABLE "HRIS_APPRAISAL_STATUS"
  (
    "EMPLOYEE_ID"  NUMBER(7,0),
    "APPRAISAL_ID" NUMBER(7,0),
    "ANNUAL_RATING_KPI" FLOAT(126),
    "ANNUAL_RATING_COMPETENCY" VARCHAR2(400 BYTE),
    "APPRAISER_OVERALL_RATING" VARCHAR2(400 BYTE),
    "REVIEWER_AGREE"           CHAR(1 BYTE),
    "APPRAISEE_AGREE"          CHAR(1 BYTE),
    "APPRAISED_BY"             NUMBER(7,0),
    "REVIEWED_BY"              NUMBER(7,0),
    "CREATED_BY"               NUMBER(7,0),
    "CREATED_DATE"             DATE DEFAULT SYSDATE,
    "MODIFIED_BY"              NUMBER(7,0),
    "MODIFIED_DATE"            NUMBER(7,0),
    "DEFAULT_RATING"           CHAR(1 BYTE) DEFAULT 'N',
    "REVIEW_PERIOD"            VARCHAR2(255 BYTE),
    "PREVIOUS_REVIEW_PERIOD"   VARCHAR2(255 BYTE),
    "PREVIOUS_RATING"          VARCHAR2(255 BYTE),
    "HR_FEEDBACK"              VARCHAR2(255 BYTE),
    "SUPER_REVIEWER_FEEDBACK"  VARCHAR2(255 BYTE),
    "SUPER_REVIEWER_AGREE"     CHAR(1 BYTE)
  ) ;
CREATE TABLE "HRIS_APPRAISAL_STAGE_QUESTIONS"
  (
    "QUESTION_ID"   NUMBER,
    "STAGE_ID"      NUMBER,
    "STATUS"        CHAR(1 BYTE),
    "CREATED_DATE"  DATE DEFAULT SYSDATE,
    "MODIFIED_DATE" DATE
  ) ;
CREATE TABLE "HRIS_APPRAISAL_STAGE"
  (
    "STAGE_ID"      NUMBER(7,0),
    "STAGE_CODE"    VARCHAR2(15 BYTE),
    "STAGE_EDESC"   VARCHAR2(100 BYTE),
    "STAGE_NDESC"   VARCHAR2(400 BYTE) DEFAULT NULL,
    "START_DATE"    DATE DEFAULT NULL,
    "END_DATE"      DATE DEFAULT NULL,
    "ORDER_NO"      NUMBER(7,0),
    "COMPANY_ID"    NUMBER(7,0),
    "BRANCH_ID"     NUMBER(7,0),
    "CREATED_BY"    NUMBER(7,0),
    "CREATED_DATE"  DATE DEFAULT SYSDATE,
    "MODIFIED_BY"   NUMBER(7,0),
    "MODIFIED_DATE" DATE,
    "CHECKED"       VARCHAR2(1 BYTE) DEFAULT 'N',
    "APPROVED_BY"   NUMBER(7,0),
    "APPROVED_DATE" DATE DEFAULT SYSDATE,
    "APPROVED"      VARCHAR2(1 BYTE) DEFAULT 'N',
    "STATUS"        CHAR(1 BYTE),
    "REMARKS"       VARCHAR2(255 BYTE)
  ) ;
CREATE TABLE "HRIS_APPRAISAL_SETUP"
  (
    "APPRAISAL_ID"         NUMBER(7,0),
    "APPRAISAL_CODE"       VARCHAR2(15 BYTE),
    "APPRAISAL_EDESC"      VARCHAR2(400 BYTE),
    "APPRAISAL_NDESC"      VARCHAR2(800 BYTE) DEFAULT NULL,
    "APPRAISAL_TYPE_ID"    NUMBER(7,0),
    "START_DATE"           DATE,
    "END_DATE"             DATE,
    "CURRENT_STAGE_ID"     NUMBER(7,0),
    "REMARKS"              VARCHAR2(200 BYTE),
    "COMPANY_ID"           NUMBER(7,0),
    "BRANCH_ID"            NUMBER(7,0),
    "CREATED_BY"           NUMBER(7,0),
    "CREATED_DATE"         DATE DEFAULT SYSDATE,
    "MODIFIED_BY"          NUMBER(7,0),
    "MODIFIED_DATE"        DATE,
    "CHECKED"              VARCHAR2(1 BYTE) DEFAULT 'N',
    "APPROVED_BY"          NUMBER(7,0),
    "APPROVED_DATE"        DATE DEFAULT SYSDATE,
    "APPROVED"             VARCHAR2(1 BYTE) DEFAULT 'N',
    "STATUS"               CHAR(1 BYTE),
    "KPI_SETTING"          CHAR(1 BYTE) DEFAULT 'N',
    "COMPETENCIES_SETTING" CHAR(1 BYTE) DEFAULT 'N',
    "HR_FEEDBACK_ENABLE"   CHAR(1 BYTE)
  ) ;
--------------------------------------------------------
--  DDL for Table HRIS_APPRAISAL_QUESTION_OPTS
--------------------------------------------------------
CREATE TABLE "HRIS_APPRAISAL_QUESTION_OPTS"
  (
    "OPTION_ID"     NUMBER(7,0),
    "OPTION_CODE"   VARCHAR2(15 BYTE),
    "QUESTION_ID"   NUMBER(7,0),
    "OPTION_EDESC"  VARCHAR2(400 BYTE),
    "OPTION_NDESC"  VARCHAR2(800 BYTE) DEFAULT NULL,
    "COMPANY_ID"    NUMBER(7,0),
    "BRANCH_ID"     NUMBER(7,0),
    "CREATED_BY"    NUMBER(7,0),
    "CREATED_DATE"  DATE DEFAULT SYSDATE,
    "MODIFIED_BY"   NUMBER(7,0),
    "MODIFIED_DATE" DATE,
    "CHECKED"       VARCHAR2(1 BYTE) DEFAULT 'N',
    "APPROVED_BY"   NUMBER(7,0),
    "APPROVED_DATE" DATE DEFAULT SYSDATE,
    "APPROVED"      VARCHAR2(1 BYTE) DEFAULT 'N',
    "STATUS"        CHAR(1 BYTE)
  ) ;
--------------------------------------------------------
--  DDL for Table HRIS_APPRAISAL_QUESTION
--------------------------------------------------------
CREATE TABLE "HRIS_APPRAISAL_QUESTION"
  (
    "QUESTION_ID"      NUMBER(7,0),
    "QUESTION_CODE"    VARCHAR2(15 BYTE),
    "HEADING_ID"       NUMBER(7,0),
    "QUESTION_EDESC"   VARCHAR2(400 BYTE),
    "QUESTION_NDESC"   VARCHAR2(800 BYTE) DEFAULT NULL,
    "APPRAISEE_FLAG"   VARCHAR2(1 BYTE),
    "APPRAISER_FLAG"   VARCHAR2(1 BYTE),
    "REVIEWER_FLAG"    VARCHAR2(1 BYTE),
    "APPRAISEE_RATING" VARCHAR2(1 BYTE),
    "APPRAISER_RATING" VARCHAR2(1 BYTE),
    "REVIEWER_RATING"  VARCHAR2(1 BYTE),
    "MAX_VALUE"        NUMBER(7,0),
    "MIN_VALUE"        NUMBER(7,0),
    "ORDER_NO"         NUMBER(7,0) DEFAULT NULL,
    "COMPANY_ID"       NUMBER(7,0),
    "BRANCH_ID"        NUMBER(7,0),
    "CREATED_BY"       NUMBER(7,0),
    "CREATED_DATE"     DATE DEFAULT SYSDATE,
    "MODIFIED_BY"      NUMBER(7,0),
    "MODIFIED_DATE"    DATE,
    "CHECKED"          VARCHAR2(1 BYTE) DEFAULT 'N',
    "APPROVED_BY"      NUMBER(7,0),
    "APPROVED_DATE"    DATE DEFAULT SYSDATE,
    "APPROVED"         VARCHAR2(1 BYTE) DEFAULT 'N',
    "STATUS"           CHAR(1 BYTE),
    "REMARKS"          VARCHAR2(255 BYTE),
    "ANSWER_TYPE"      VARCHAR2(30 BYTE),
    "HR_FLAG"          CHAR(1 BYTE) DEFAULT 'N',
    "HR_RATING"        CHAR(1 BYTE) DEFAULT 'N'
  ) ;
--------------------------------------------------------
--  DDL for Table HRIS_APPRAISAL_KPI
--------------------------------------------------------
CREATE TABLE "HRIS_APPRAISAL_KPI"
  (
    "SNO"              NUMBER(7,0),
    "APPRAISAL_ID"     NUMBER(7,0),
    "EMPLOYEE_ID"      NUMBER(7,0),
    "TITLE"            VARCHAR2(200 BYTE),
    "SUCCESS_CRITERIA" VARCHAR2(4000 BYTE),
    "WEIGHT"           NUMBER(5,2),
    "KEY_ACHIEVEMENT"  VARCHAR2(4000 BYTE) DEFAULT NULL,
    "SELF_RATING" FLOAT(126) DEFAULT NULL,
    "APPRAISER_RATING" FLOAT(126) DEFAULT NULL,
    "REVIEWER_RATING" FLOAT(126) DEFAULT NULL,
    "COMPANY_ID"    NUMBER(7,0),
    "BRANCH_ID"     NUMBER(7,0) DEFAULT NULL,
    "CREATED_BY"    NUMBER(7,0),
    "CREATED_DATE"  DATE,
    "MODIFIED_BY"   NUMBER(7,0),
    "MODIFIED_DATE" DATE,
    "CHECKED"       VARCHAR2(1 BYTE) DEFAULT 'N',
    "APPROVED_BY"   NUMBER(7,0),
    "APPROVED_DATE" DATE,
    "APPROVED"      VARCHAR2(1 BYTE) DEFAULT 'N',
    "STATUS"        CHAR(1 BYTE)
  ) ;
--------------------------------------------------------
--  DDL for Table HRIS_APPRAISAL_HEADING
--------------------------------------------------------
CREATE TABLE "HRIS_APPRAISAL_HEADING"
  (
    "HEADING_ID"        NUMBER(7,0),
    "HEADING_CODE"      VARCHAR2(15 BYTE),
    "APPRAISAL_TYPE_ID" NUMBER(7,0),
    "PERCENTAGE"        NUMBER(5,2) DEFAULT 0,
    "HEADING_EDESC"     VARCHAR2(400 BYTE),
    "HEADING_NDESC"     VARCHAR2(800 BYTE) DEFAULT NULL,
    "COMPANY_ID"        NUMBER(7,0),
    "BRANCH_ID"         NUMBER(7,0),
    "CREATED_BY"        NUMBER(7,0),
    "CREATED_DATE"      DATE DEFAULT SYSDATE,
    "MODIFIED_BY"       NUMBER(7,0),
    "MODIFIED_DATE"     DATE,
    "CHECKED"           VARCHAR2(1 BYTE) DEFAULT 'N',
    "APPROVED_BY"       NUMBER(7,0),
    "APPROVED_DATE"     DATE DEFAULT SYSDATE,
    "APPROVED"          VARCHAR2(1 BYTE) DEFAULT 'N',
    "STATUS"            CHAR(1 BYTE),
    "REMARKS"           VARCHAR2(255 BYTE)
  ) ;
--------------------------------------------------------
--  DDL for Table HRIS_APPRAISAL_DEFAULT
--------------------------------------------------------
CREATE TABLE "HRIS_APPRAISAL_DEFAULT"
  (
    "ID" NUMBER(7,0),
    "MIN_VALUE" FLOAT(126),
    "MAX_VALUE" FLOAT(126),
    "APPRAISAL_TYPE_ID" NUMBER(7,0),
    "DESIGNATION_IDS"   VARCHAR2(255 BYTE),
    "POSITION_IDS"      VARCHAR2(255 BYTE) DEFAULT NULL,
    "COMPANY_ID"        NUMBER(7,0),
    "BRANCH_ID"         NUMBER(7,0) DEFAULT NULL,
    "CREATED_BY"        NUMBER(7,0),
    "CREATED_DATE"      DATE,
    "MODIFIED_BY"       NUMBER(7,0),
    "MODIFIED_DATE"     DATE,
    "CHECKED"           VARCHAR2(1 BYTE) DEFAULT 'N',
    "APPROVED_BY"       NUMBER(7,0),
    "APPROVED_DATE"     DATE,
    "APPROVED"          VARCHAR2(1 BYTE) DEFAULT 'N',
    "STATUS"            CHAR(1 BYTE),
    "DEFAULT_VALUE" FLOAT(126)
  ) ;
--------------------------------------------------------
--  DDL for Table HRIS_APPRAISAL_ASSIGN
--------------------------------------------------------
CREATE TABLE "HRIS_APPRAISAL_ASSIGN"
  (
    "APPRAISAL_ID"      NUMBER(7,0),
    "EMPLOYEE_ID"       NUMBER(7,0),
    "APPRAISER_ID"      NUMBER(7,0),
    "REVIEWER_ID"       NUMBER(7,0),
    "REMARKS"           VARCHAR2(100 BYTE) DEFAULT NULL,
    "COMPANY_ID"        NUMBER(7,0),
    "BRANCH_ID"         NUMBER(7,0),
    "CREATED_BY"        NUMBER(7,0),
    "CREATED_DATE"      DATE DEFAULT SYSDATE,
    "MODIFIED_BY"       NUMBER(7,0),
    "MODIFIED_DATE"     DATE,
    "CHECKED"           VARCHAR2(1 BYTE) DEFAULT 'N',
    "APPROVED_BY"       NUMBER(7,0),
    "APPROVED_DATE"     DATE DEFAULT SYSDATE,
    "APPROVED"          VARCHAR2(1 BYTE) DEFAULT 'N',
    "STATUS"            CHAR(1 BYTE),
    "CURRENT_STAGE_ID"  NUMBER(7,0),
    "ALT_APPRAISER_ID"  NUMBER(7,0),
    "ALT_REVIEWER_ID"   NUMBER(7,0),
    "SUPER_REVIEWER_ID" NUMBER(7,0)
  ) ;
--------------------------------------------------------
--  DDL for Table HRIS_APPRAISAL_COMPETENCY
--------------------------------------------------------
CREATE TABLE "HRIS_APPRAISAL_COMPETENCY"
  (
    "APPRAISAL_ID"  NUMBER(7,0),
    "EMPLOYEE_ID"   NUMBER(7,0),
    "SNO"           NUMBER(7,0),
    "TITLE"         VARCHAR2(200 BYTE),
    "RATING"        VARCHAR2(400 BYTE),
    "COMMENTS"      VARCHAR2(4000 BYTE) DEFAULT NULL,
    "COMPANY_ID"    NUMBER(7,0),
    "BRANCH_ID"     NUMBER(7,0) DEFAULT NULL,
    "CREATED_BY"    NUMBER(7,0),
    "CREATED_DATE"  DATE,
    "MODIFIED_BY"   NUMBER(7,0),
    "MODIFIED_DATE" DATE,
    "CHECKED"       VARCHAR2(1 BYTE) DEFAULT 'N',
    "APPROVED_BY"   NUMBER(7,0),
    "APPROVED_DATE" DATE,
    "APPROVED"      VARCHAR2(1 BYTE) DEFAULT 'N',
    "STATUS"        CHAR(1 BYTE)
  ) ;
--------------------------------------------------------
--  DDL for Table HRIS_APPRAISAL_ANSWER
--------------------------------------------------------
CREATE TABLE "HRIS_APPRAISAL_ANSWER"
  (
    "ANSWER_ID"     NUMBER(7,0),
    "APPRAISAL_ID"  NUMBER(7,0),
    "QUESTION_ID"   NUMBER(7,0),
    "EMPLOYEE_ID"   NUMBER(7,0),
    "USER_ID"       NUMBER(7,0),
    "ANSWER"        VARCHAR2(2000 BYTE),
    "RATING"        NUMBER(5,2),
    "STAGE_ID"      NUMBER(7,0),
    "REMARKS"       VARCHAR2(100 BYTE) DEFAULT NULL,
    "STATUS"        VARCHAR2(2 BYTE),
    "COMPANY_ID"    NUMBER(7,0),
    "BRANCH_ID"     NUMBER(7,0),
    "CREATED_BY"    NUMBER(7,0),
    "CREATED_DATE"  DATE DEFAULT SYSDATE,
    "MODIFIED_BY"   NUMBER(7,0),
    "MODIFIED_DATE" DATE,
    "CHECKED"       VARCHAR2(1 BYTE) DEFAULT 'N',
    "APPROVED_BY"   NUMBER(7,0),
    "APPROVED_DATE" DATE DEFAULT SYSDATE,
    "APPROVED"      VARCHAR2(1 BYTE) DEFAULT 'N'
  ) ;

--------------------------------------------------------
--  DDL for Index PK_APL_TYPE
--------------------------------------------------------
CREATE UNIQUE INDEX "PK_APL_TYPE" ON "HRIS_APPRAISAL_TYPE"
  (
    "APPRAISAL_TYPE_ID"
  )
  ;
  --------------------------------------------------------
  --  DDL for Index PK_APPRAISAL_STATUS
  --------------------------------------------------------
CREATE UNIQUE INDEX "PK_APPRAISAL_STATUS" ON "HRIS_APPRAISAL_STATUS"
  (
    "EMPLOYEE_ID", "APPRAISAL_ID"
  )
  ;
  --------------------------------------------------------
  --  DDL for Index PK_APL_STAGE
  --------------------------------------------------------
CREATE UNIQUE INDEX "PK_APL_STAGE" ON "HRIS_APPRAISAL_STAGE"
  (
    "STAGE_ID"
  )
  ;
  --------------------------------------------------------
  --  DDL for Index PK_APL_SETUP
  --------------------------------------------------------
CREATE UNIQUE INDEX "PK_APL_SETUP" ON "HRIS_APPRAISAL_SETUP"
  (
    "APPRAISAL_ID"
  )
  ;
  --------------------------------------------------------
  --  DDL for Index PK_APL_QTN_OP
  --------------------------------------------------------
CREATE UNIQUE INDEX "PK_APL_QTN_OP" ON "HRIS_APPRAISAL_QUESTION_OPTS"
  (
    "OPTION_ID"
  )
  ;
  --------------------------------------------------------
  --  DDL for Index PK_APL_QUESTION
  --------------------------------------------------------
CREATE UNIQUE INDEX "PK_APL_QUESTION" ON "HRIS_APPRAISAL_QUESTION"
  (
    "QUESTION_ID"
  )
  ;
  --------------------------------------------------------
  --  DDL for Index PK_APPRAISAL_KPI
  --------------------------------------------------------
CREATE UNIQUE INDEX "PK_APPRAISAL_KPI" ON "HRIS_APPRAISAL_KPI"
  (
    "SNO"
  )
  ;
  --------------------------------------------------------
  --  DDL for Index PK_APL_HEADING
  --------------------------------------------------------
CREATE UNIQUE INDEX "PK_APL_HEADING" ON "HRIS_APPRAISAL_HEADING"
  (
    "HEADING_ID"
  )
  ;
  --------------------------------------------------------
  --  DDL for Index PK_APPRAISAL_DEFAULT
  --------------------------------------------------------
CREATE UNIQUE INDEX "PK_APPRAISAL_DEFAULT" ON "HRIS_APPRAISAL_DEFAULT"
  (
    "ID"
  )
  ;
  --------------------------------------------------------
  --  DDL for Index PK_APL_ASGN
  --------------------------------------------------------
CREATE UNIQUE INDEX "PK_APL_ASGN" ON "HRIS_APPRAISAL_ASSIGN"
  (
    "APPRAISAL_ID", "EMPLOYEE_ID"
  )
  ;
  --------------------------------------------------------
  --  DDL for Index PK_APPRAISAL_COM
  --------------------------------------------------------
CREATE UNIQUE INDEX "PK_APPRAISAL_COM" ON "HRIS_APPRAISAL_COMPETENCY"
  (
    "SNO"
  )
  ;
  --------------------------------------------------------
  --  DDL for Index PK_APL_ANS
  --------------------------------------------------------
CREATE UNIQUE INDEX "PK_APL_ANS" ON "HRIS_APPRAISAL_ANSWER"
  (
    "ANSWER_ID"
  )
  ;
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_TYPE
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_TYPE" ADD CONSTRAINT "PK_APL_TYPE" PRIMARY KEY ("APPRAISAL_TYPE_ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_TYPE" MODIFY ("APPRAISAL_TYPE_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_TYPE" MODIFY ("APPRAISAL_TYPE_EDESC" NOT NULL ENABLE);
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_STATUS
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_STATUS" ADD CONSTRAINT "PK_APPRAISAL_STATUS" PRIMARY KEY ("EMPLOYEE_ID", "APPRAISAL_ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_STATUS" MODIFY ("EMPLOYEE_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_STATUS" MODIFY ("APPRAISAL_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_STATUS" MODIFY ("CREATED_DATE" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_STATUS" ADD CHECK (REVIEWER_AGREE       IN('Y','N')) ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_STATUS" ADD CHECK (APPRAISEE_AGREE      IN('Y','N')) ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_STATUS" ADD CHECK (DEFAULT_RATING       IN ('Y','N')) ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_STATUS" ADD CHECK (SUPER_REVIEWER_AGREE IN ('Y','N')) ENABLE;
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_STAGE_QUESTIONS
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_STAGE_QUESTIONS" MODIFY ("QUESTION_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_STAGE_QUESTIONS" MODIFY ("STAGE_ID" NOT NULL ENABLE);
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_STAGE
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_STAGE" ADD CONSTRAINT "PK_APL_STAGE" PRIMARY KEY ("STAGE_ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_STAGE" MODIFY ("STAGE_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_STAGE" MODIFY ("STAGE_EDESC" NOT NULL ENABLE);
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_SETUP
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_SETUP" ADD CONSTRAINT "PK_APL_SETUP" PRIMARY KEY ("APPRAISAL_ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_SETUP" MODIFY ("APPRAISAL_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_SETUP" MODIFY ("APPRAISAL_EDESC" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_SETUP" ADD CHECK (KPI_SETTING          IN('Y','N')) ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_SETUP" ADD CHECK (COMPETENCIES_SETTING IN('Y','N')) ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_SETUP" ADD CHECK (HR_FEEDBACK_ENABLE   IN ('Y','N')) ENABLE;
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_QUESTION_OPTS
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_QUESTION_OPTS" ADD CONSTRAINT "PK_APL_QTN_OP" PRIMARY KEY ("OPTION_ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION_OPTS" MODIFY ("OPTION_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_QUESTION_OPTS" MODIFY ("OPTION_CODE" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_QUESTION_OPTS" MODIFY ("QUESTION_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_QUESTION_OPTS" MODIFY ("OPTION_EDESC" NOT NULL ENABLE);
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_QUESTION
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" ADD CONSTRAINT "PK_APL_QUESTION" PRIMARY KEY ("QUESTION_ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" MODIFY ("QUESTION_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" MODIFY ("HEADING_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" MODIFY ("QUESTION_EDESC" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" ADD CHECK (ANSWER_TYPE IN ('TEXT','TEXTAREA','NUMBER','PERCENTAGE','CHECKBOX','RADIO','SELECT')) ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" MODIFY ("ANSWER_TYPE" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" ADD CHECK (HR_FLAG   IN ('Y','N')) ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" ADD CHECK (HR_RATING IN ('Y','N')) ENABLE;
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_KPI
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_KPI" ADD CONSTRAINT "PK_APPRAISAL_KPI" PRIMARY KEY ("SNO") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_KPI" MODIFY ("SNO" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_KPI" MODIFY ("APPRAISAL_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_KPI" MODIFY ("EMPLOYEE_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_KPI" MODIFY ("TITLE" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_KPI" MODIFY ("WEIGHT" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_KPI" ADD CHECK (STATUS IN('E','D')) ENABLE;
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_HEADING
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_HEADING" ADD CONSTRAINT "PK_APL_HEADING" PRIMARY KEY ("HEADING_ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_HEADING" MODIFY ("HEADING_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_HEADING" MODIFY ("APPRAISAL_TYPE_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_HEADING" MODIFY ("HEADING_EDESC" NOT NULL ENABLE);
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_DEFAULT
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" ADD CONSTRAINT "PK_APPRAISAL_DEFAULT" PRIMARY KEY ("ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" MODIFY ("ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" MODIFY ("MIN_VALUE" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" MODIFY ("MAX_VALUE" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" MODIFY ("APPRAISAL_TYPE_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" MODIFY ("DESIGNATION_IDS" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" ADD CHECK (STATUS IN('E','D')) ENABLE;
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_ASSIGN
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "PK_APL_ASGN" PRIMARY KEY ("APPRAISAL_ID", "EMPLOYEE_ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" MODIFY ("APPRAISAL_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" MODIFY ("EMPLOYEE_ID" NOT NULL ENABLE);
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_COMPETENCY
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" ADD CONSTRAINT "PK_APPRAISAL_COM" PRIMARY KEY ("SNO") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" MODIFY ("APPRAISAL_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" MODIFY ("EMPLOYEE_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" MODIFY ("SNO" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" MODIFY ("TITLE" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" ADD CHECK (STATUS IN('E','D')) ENABLE;
  --------------------------------------------------------
  --  Constraints for Table HRIS_APPRAISAL_ANSWER
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" ADD CONSTRAINT "PK_APL_ANS" PRIMARY KEY ("ANSWER_ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" MODIFY ("ANSWER_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" MODIFY ("APPRAISAL_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" MODIFY ("QUESTION_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" MODIFY ("EMPLOYEE_ID" NOT NULL ENABLE);
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" MODIFY ("USER_ID" NOT NULL ENABLE);
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_TYPE
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_TYPE" ADD CONSTRAINT "FK_APL_TYPE_BRANCH_BNC_ID" FOREIGN KEY ("BRANCH_ID") REFERENCES "HRIS_BRANCHES" ("BRANCH_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_TYPE" ADD CONSTRAINT "FK_APL_TYPE_COMPANY_COM_ID" FOREIGN KEY ("COMPANY_ID") REFERENCES "HRIS_COMPANY" ("COMPANY_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_TYPE" ADD CONSTRAINT "FK_APL_TYPE_EMPLOYEE_EMP_ID" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_TYPE" ADD CONSTRAINT "FK_APL_TYPE_EMPLOYEE_EMP_ID2" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_TYPE" ADD CONSTRAINT "FK_APL_TYPE_EMPLOYEE_EMP_ID3" FOREIGN KEY ("APPROVED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_STATUS
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_STATUS" ADD CONSTRAINT "FK_APP_STATUS_APP_APP_ID" FOREIGN KEY ("APPRAISAL_ID") REFERENCES "HRIS_APPRAISAL_SETUP" ("APPRAISAL_ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_STATUS" ADD CONSTRAINT "FK_APP_STATUS_EMP_EMP_ID" FOREIGN KEY ("EMPLOYEE_ID") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_STATUS" ADD CONSTRAINT "FK_APP_STATUS_EMP_EMP_ID1" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_STATUS" ADD CONSTRAINT "FK_APP_STATUS_EMP_EMP_ID2" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_STATUS" ADD CONSTRAINT "FK_APP_STATUS_EMP_EMP_ID3" FOREIGN KEY ("REVIEWED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_STATUS" ADD CONSTRAINT "FK_APP_STATUS_EMP_EMP_ID4" FOREIGN KEY ("APPRAISED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_STAGE_QUESTIONS
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_STAGE_QUESTIONS" ADD CONSTRAINT "FK_APSTGQ_STAGE_QUESTION_ID" FOREIGN KEY ("QUESTION_ID") REFERENCES "HRIS_APPRAISAL_QUESTION" ("QUESTION_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_STAGE_QUESTIONS" ADD CONSTRAINT "FK_APSTGQ_STAGE_STAGE_ID" FOREIGN KEY ("STAGE_ID") REFERENCES "HRIS_APPRAISAL_STAGE" ("STAGE_ID") DISABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_STAGE
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_STAGE" ADD CONSTRAINT "FK_APL_STG_BRANCH_BNC_ID" FOREIGN KEY ("BRANCH_ID") REFERENCES "HRIS_BRANCHES" ("BRANCH_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_STAGE" ADD CONSTRAINT "FK_APL_STG_COMPANY_COM_ID" FOREIGN KEY ("COMPANY_ID") REFERENCES "HRIS_COMPANY" ("COMPANY_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_STAGE" ADD CONSTRAINT "FK_APL_STG_EMPLOYEE_EMP_ID" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_STAGE" ADD CONSTRAINT "FK_APL_STG_EMPLOYEE_EMP_ID2" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_STAGE" ADD CONSTRAINT "FK_APL_STG_EMPLOYEE_EMP_ID3" FOREIGN KEY ("APPROVED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_SETUP
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_SETUP" ADD CONSTRAINT "FK_APL_BRANCH_BNC_ID" FOREIGN KEY ("BRANCH_ID") REFERENCES "HRIS_BRANCHES" ("BRANCH_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_SETUP" ADD CONSTRAINT "FK_APL_COMPANY_COM_ID" FOREIGN KEY ("COMPANY_ID") REFERENCES "HRIS_COMPANY" ("COMPANY_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_SETUP" ADD CONSTRAINT "FK_APL_EMPLOYEE_EMP_ID" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_SETUP" ADD CONSTRAINT "FK_APL_EMPLOYEE_EMP_ID2" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_SETUP" ADD CONSTRAINT "FK_APL_EMPLOYEE_EMP_ID3" FOREIGN KEY ("APPROVED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_SETUP" ADD CONSTRAINT "FK_APL_SETUP1" FOREIGN KEY ("CURRENT_STAGE_ID") REFERENCES "HRIS_APPRAISAL_STAGE" ("STAGE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_SETUP" ADD CONSTRAINT "FK_APL_SETUP2" FOREIGN KEY ("APPRAISAL_TYPE_ID") REFERENCES "HRIS_APPRAISAL_TYPE" ("APPRAISAL_TYPE_ID") ENABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_QUESTION_OPTS
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_QUESTION_OPTS" ADD CONSTRAINT "FK_APL_QTN_OPT" FOREIGN KEY ("QUESTION_ID") REFERENCES "HRIS_APPRAISAL_QUESTION" ("QUESTION_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION_OPTS" ADD CONSTRAINT "FK_APL_QTN_OP_BRANCH_BNC_ID" FOREIGN KEY ("BRANCH_ID") REFERENCES "HRIS_BRANCHES" ("BRANCH_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION_OPTS" ADD CONSTRAINT "FK_APL_QTN_OP_COMPANY_COM_ID" FOREIGN KEY ("COMPANY_ID") REFERENCES "HRIS_COMPANY" ("COMPANY_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION_OPTS" ADD CONSTRAINT "FK_APL_QTN_OP_EMPLOYEE_EMP_ID" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION_OPTS" ADD CONSTRAINT "FK_APL_QTN_OP_EMPLOYEE_EMP_ID2" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION_OPTS" ADD CONSTRAINT "FK_APL_QTN_OP_EMPLOYEE_EMP_ID3" FOREIGN KEY ("APPROVED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_QUESTION
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" ADD CONSTRAINT "FK_APL_QTN_BRANCH_BNC_ID" FOREIGN KEY ("BRANCH_ID") REFERENCES "HRIS_BRANCHES" ("BRANCH_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" ADD CONSTRAINT "FK_APL_QTN_COMPANY_COM_ID" FOREIGN KEY ("COMPANY_ID") REFERENCES "HRIS_COMPANY" ("COMPANY_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" ADD CONSTRAINT "FK_APL_QTN_EMPLOYEE_EMP_ID" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" ADD CONSTRAINT "FK_APL_QTN_EMPLOYEE_EMP_ID2" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" ADD CONSTRAINT "FK_APL_QTN_EMPLOYEE_EMP_ID3" FOREIGN KEY ("APPROVED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_QUESTION" ADD CONSTRAINT "FK_APL_QUESTION" FOREIGN KEY ("HEADING_ID") REFERENCES "HRIS_APPRAISAL_HEADING" ("HEADING_ID") DISABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_KPI
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_KPI" ADD CONSTRAINT "FK_APPRAISAL_KPI_APP_APP_ID" FOREIGN KEY ("APPRAISAL_ID") REFERENCES "HRIS_APPRAISAL_SETUP" ("APPRAISAL_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_KPI" ADD CONSTRAINT "FK_APP_KPI_BRN_BRANCH_ID" FOREIGN KEY ("BRANCH_ID") REFERENCES "HRIS_BRANCHES" ("BRANCH_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_KPI" ADD CONSTRAINT "FK_APP_KPI_COM_COMPANY_ID" FOREIGN KEY ("COMPANY_ID") REFERENCES "HRIS_COMPANY" ("COMPANY_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_KPI" ADD CONSTRAINT "FK_APP_KPI_EMP_EMPLOYEE_ID" FOREIGN KEY ("EMPLOYEE_ID") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_KPI" ADD CONSTRAINT "FK_APP_KPI_EMP_EMPLOYEE_ID1" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_KPI" ADD CONSTRAINT "FK_APP_KPI_EMP_EMPLOYEE_ID2" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_KPI" ADD CONSTRAINT "FK_APP_KPI_EMP_EMPLOYEE_ID3" FOREIGN KEY ("APPROVED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_HEADING
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_HEADING" ADD CONSTRAINT "FK_APL_HDG_BRANCH_BNC_ID" FOREIGN KEY ("BRANCH_ID") REFERENCES "HRIS_BRANCHES" ("BRANCH_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_HEADING" ADD CONSTRAINT "FK_APL_HDG_COMPANY_COM_ID" FOREIGN KEY ("COMPANY_ID") REFERENCES "HRIS_COMPANY" ("COMPANY_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_HEADING" ADD CONSTRAINT "FK_APL_HDG_EMPLOYEE_EMP_ID" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_HEADING" ADD CONSTRAINT "FK_APL_HDG_EMPLOYEE_EMP_ID2" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_HEADING" ADD CONSTRAINT "FK_APL_HDG_EMPLOYEE_EMP_ID3" FOREIGN KEY ("APPROVED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_HEADING" ADD CONSTRAINT "FK_APL_HEADING" FOREIGN KEY ("APPRAISAL_TYPE_ID") REFERENCES "HRIS_APPRAISAL_TYPE" ("APPRAISAL_TYPE_ID") ENABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_DEFAULT
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" ADD CONSTRAINT "FK_APP_DFT_APP_TP_APP_TP_ID" FOREIGN KEY ("APPRAISAL_TYPE_ID") REFERENCES "HRIS_APPRAISAL_TYPE" ("APPRAISAL_TYPE_ID") ENABLE;
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" ADD CONSTRAINT "FK_APP_DFT_BRN_BRANCH_ID" FOREIGN KEY ("BRANCH_ID") REFERENCES "HRIS_BRANCHES" ("BRANCH_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" ADD CONSTRAINT "FK_APP_DFT_COM_COMPANY_ID" FOREIGN KEY ("COMPANY_ID") REFERENCES "HRIS_COMPANY" ("COMPANY_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" ADD CONSTRAINT "FK_APP_DFT_EMP_EMPLOYEE_ID1" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" ADD CONSTRAINT "FK_APP_DFT_EMP_EMPLOYEE_ID2" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_DEFAULT" ADD CONSTRAINT "FK_APP_DFT_EMP_EMPLOYEE_ID3" FOREIGN KEY ("APPROVED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_ASSIGN
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APL_ASGN_APPRAISAL_APL_ID" FOREIGN KEY ("APPRAISAL_ID") REFERENCES "HRIS_APPRAISAL_SETUP" ("APPRAISAL_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APL_ASGN_BRANCH_BNC_ID" FOREIGN KEY ("BRANCH_ID") REFERENCES "HRIS_BRANCHES" ("BRANCH_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APL_ASGN_COMPANY_COM_ID" FOREIGN KEY ("COMPANY_ID") REFERENCES "HRIS_COMPANY" ("COMPANY_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APL_ASGN_EMPLOYEE_EMP_ID" FOREIGN KEY ("EMPLOYEE_ID") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APL_ASGN_EMPLOYEE_EMP_ID2" FOREIGN KEY ("APPRAISER_ID") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APL_ASGN_EMPLOYEE_EMP_ID3" FOREIGN KEY ("REVIEWER_ID") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APL_ASGN_EMPLOYEE_EMP_ID4" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APL_ASGN_EMPLOYEE_EMP_ID5" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APL_ASGN_EMPLOYEE_EMP_ID6" FOREIGN KEY ("APPROVED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APL_ASGN_EMPLOYEE_EMP_ID7" FOREIGN KEY ("ALT_APPRAISER_ID") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APL_ASGN_EMPLOYEE_EMP_ID8" FOREIGN KEY ("ALT_REVIEWER_ID") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ASSIGN" ADD CONSTRAINT "FK_APP_ASN_EMP_EMP_ID" FOREIGN KEY ("SUPER_REVIEWER_ID") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_COMPETENCY
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" ADD CONSTRAINT "FK_APP_COM_APP_APP_ID" FOREIGN KEY ("APPRAISAL_ID") REFERENCES "HRIS_APPRAISAL_SETUP" ("APPRAISAL_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" ADD CONSTRAINT "FK_APP_COM_BRN_BRANCH_ID" FOREIGN KEY ("BRANCH_ID") REFERENCES "HRIS_BRANCHES" ("BRANCH_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" ADD CONSTRAINT "FK_APP_COM_COM_COMPANY_ID" FOREIGN KEY ("COMPANY_ID") REFERENCES "HRIS_COMPANY" ("COMPANY_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" ADD CONSTRAINT "FK_APP_COM_EMP_EMPLOYEE_ID" FOREIGN KEY ("EMPLOYEE_ID") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" ADD CONSTRAINT "FK_APP_COM_EMP_EMPLOYEE_ID1" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" ADD CONSTRAINT "FK_APP_COM_EMP_EMPLOYEE_ID2" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_COMPETENCY" ADD CONSTRAINT "FK_APP_COM_EMP_EMPLOYEE_ID3" FOREIGN KEY ("APPROVED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  --------------------------------------------------------
  --  Ref Constraints for Table HRIS_APPRAISAL_ANSWER
  --------------------------------------------------------
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" ADD CONSTRAINT "FK_APLL_ANS_EMPLOYEE_EMP_ID" FOREIGN KEY ("EMPLOYEE_ID") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" ADD CONSTRAINT "FK_APL_ANS_APPRAISAL_APL_ID" FOREIGN KEY ("APPRAISAL_ID") REFERENCES "HRIS_APPRAISAL_SETUP" ("APPRAISAL_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" ADD CONSTRAINT "FK_APL_ANS_BRANCH_BNC_ID" FOREIGN KEY ("BRANCH_ID") REFERENCES "HRIS_BRANCHES" ("BRANCH_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" ADD CONSTRAINT "FK_APL_ANS_COMPANY_COM_ID" FOREIGN KEY ("COMPANY_ID") REFERENCES "HRIS_COMPANY" ("COMPANY_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" ADD CONSTRAINT "FK_APL_ANS_EMPLOYEE_EMP_ID2" FOREIGN KEY ("USER_ID") REFERENCES "HRIS_USERS" ("USER_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" ADD CONSTRAINT "FK_APL_ANS_EMPLOYEE_EMP_ID3" FOREIGN KEY ("CREATED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" ADD CONSTRAINT "FK_APL_ANS_EMPLOYEE_EMP_ID4" FOREIGN KEY ("MODIFIED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" ADD CONSTRAINT "FK_APL_ANS_EMPLOYEE_EMP_ID5" FOREIGN KEY ("APPROVED_BY") REFERENCES "HRIS_EMPLOYEES" ("EMPLOYEE_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" ADD CONSTRAINT "FK_APL_ANS_QUESTION_QUT_ID" FOREIGN KEY ("QUESTION_ID") REFERENCES "HRIS_APPRAISAL_QUESTION" ("QUESTION_ID") DISABLE;
  ALTER TABLE "HRIS_APPRAISAL_ANSWER" ADD CONSTRAINT "HR_APL_ANS_STAGE_STG_ID" FOREIGN KEY ("STAGE_ID") REFERENCES "HRIS_APPRAISAL_STAGE" ("STAGE_ID") DISABLE;
  --------------------------------------------------------
  --  DDL for Trigger APPRAISAL_STATUS_TRIGGER
  --------------------------------------------------------
CREATE OR REPLACE TRIGGER "APPRAISAL_STATUS_TRIGGER" AFTER
  INSERT ON HRIS_APPRAISAL_ASSIGN FOR EACH ROW BEGIN
  INSERT
  INTO HRIS_APPRAISAL_STATUS
    (
      EMPLOYEE_ID,
      APPRAISAL_ID
    )
    VALUES
    (
      :new.EMPLOYEE_ID,
      :new.APPRAISAL_ID
    );
END;
/
ALTER TRIGGER "APPRAISAL_STATUS_TRIGGER" ENABLE;


ALTER TABLE HRIS_EMPLOYEES ADD IS_CEO CHAR (1 BYTE) DEFAULT 'N' CHECK (IS_CEO IN ('Y','N'));
ALTER TABLE HRIS_EMPLOYEES ADD IS_HR  CHAR (1 BYTE) DEFAULT 'N' CHECK (IS_HR  IN ('Y','N'));
ALTER TABLE HRIS_EMPLOYEES ADD IS_DCEO CHAR (1 BYTE) DEFAULT 'N' CHECK (IS_DCEO IN ('Y','N'));


ALTER TABLE HRIS_APPRAISAL_TYPE ADD DURATION_TYPE CHAR(1 BYTE) DEFAULT 'A' NOT NULL CHECK(DURATION_TYPE IN ('A','M'));



ALTER TABLE HRIS_APPRAISAL_SETUP ADD FISCAL_YEAR_ID NUMBER(7,0) ;
ALTER TABLE HRIS_APPRAISAL_SETUP ADD FISCAL_YEAR_MONTH_NO NUMBER(2,0);