CREATE TABLE MNEMONIC (
  ID NUMBER(10) NOT NULL, 
  MNEMONIC VARCHAR2(50) NOT NULL, 
  LABEL VARCHAR2(255) DEFAULT NULL NULL, 
  ORGANIZATION_ID NUMBER(10) 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, 
  IS_ACTIVE VARCHAR2(1) DEFAULT 'Y' NOT NULL,
  CONSTRAINT MNEMONIC_PK PRIMARY KEY(ID)
)
/
ALTER TABLE MNEMONIC ADD CONSTRAINT MNEMONIC_ORG_FK FOREIGN KEY (ORGANIZATION_ID) REFERENCES ORGANIZATION (ID)
/
ALTER TABLE MNEMONIC ADD CONSTRAINT MNEMONIC_USER_FK1 FOREIGN KEY (CREATED_BY) REFERENCES ZH_USER (ID)
/
ALTER TABLE MNEMONIC ADD CONSTRAINT MNEMONIC_USER_FK2 FOREIGN KEY (UPDATED_BY) REFERENCES ZH_USER (ID)
/
ALTER TABLE MNEMONIC ADD CONSTRAINT CKC_MNEMONIC_IS_ACTIVE CHECK (IS_ACTIVE in ('Y','N','D'))
/
CREATE SEQUENCE MNEMONIC_ID_SEQ START WITH 1 MINVALUE 1 INCREMENT BY 1
/
CREATE TABLE PRODUCT_FILES_MNEMONIC (
  ID NUMBER(10) NOT NULL, 
  MNEMONIC_ID NUMBER(10) NOT NULL, 
  PRODUCT_FILES_ID NUMBER(10) NOT NULL, 
  ORGANIZATION_ID NUMBER(10) 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, 
  IS_ACTIVE VARCHAR2(255) DEFAULT 'Y' NOT NULL,
  CONSTRAINT PRODUCT_FILES_MNEMONIC_PK PRIMARY KEY(ID)
)
/
ALTER TABLE PRODUCT_FILES_MNEMONIC ADD CONSTRAINT PROD_FILES_MNEMO_MNEMONIC_FK FOREIGN KEY (MNEMONIC_ID) REFERENCES MNEMONIC (ID)
/
ALTER TABLE PRODUCT_FILES_MNEMONIC ADD CONSTRAINT PROD_FILES_MNEMO_PROD_FILES_FK FOREIGN KEY (PRODUCT_FILES_ID) REFERENCES PRODUCT_FILES (ID)
/
ALTER TABLE PRODUCT_FILES_MNEMONIC ADD CONSTRAINT PROD_FILES_MNEMO_ORG FOREIGN KEY (ORGANIZATION_ID) REFERENCES ORGANIZATION (ID)
/
ALTER TABLE PRODUCT_FILES_MNEMONIC ADD CONSTRAINT PROD_FILES_MNEMO_USER_FK1 FOREIGN KEY (CREATED_BY) REFERENCES ZH_USER (ID)
/
ALTER TABLE PRODUCT_FILES_MNEMONIC ADD CONSTRAINT PROD_FILES_MNEMO_USER_FK2 FOREIGN KEY (UPDATED_BY) REFERENCES ZH_USER (ID)
/
ALTER TABLE PRODUCT_FILES_MNEMONIC ADD CONSTRAINT CKC_PROD_FILES_MNEMO_IS_ACTIVE CHECK (IS_ACTIVE in ('Y','N','D'))
/
CREATE SEQUENCE PRODUCT_FILES_MNEMONIC_ID_SEQ START WITH 1 MINVALUE 1 INCREMENT BY 1
/
CREATE TABLE SERVER_MNEMONIC (
  ID NUMBER(10) NOT NULL, 
  SERVER_ID NUMBER(10) NOT NULL, 
  MNEMONIC_ID NUMBER(10) NOT NULL, 
  VALUE VARCHAR2(255) NOT NULL, 
  ORGANIZATION_ID NUMBER(10) 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, 
  IS_ACTIVE VARCHAR2(1) DEFAULT 'Y' NOT NULL,
  CONSTRAINT SERVER_MNEMONIC_PK PRIMARY KEY(ID)
)
/
ALTER TABLE SERVER_MNEMONIC ADD CONSTRAINT SERVER_MNEMONIC_SERVER_FK FOREIGN KEY (SERVER_ID) REFERENCES SERVER (ID)
/
ALTER TABLE SERVER_MNEMONIC ADD CONSTRAINT SERVER_MNEMONIC_MNEMONIC_FK FOREIGN KEY (MNEMONIC_ID) REFERENCES MNEMONIC (ID)
/
ALTER TABLE SERVER_MNEMONIC ADD CONSTRAINT SERVER_MNEMONIC_ORG FOREIGN KEY (ORGANIZATION_ID) REFERENCES ORGANIZATION (ID)
/
ALTER TABLE SERVER_MNEMONIC ADD CONSTRAINT SERVER_MNEMONIC_USER_FK1 FOREIGN KEY (CREATED_BY) REFERENCES ZH_USER (ID)
/
ALTER TABLE SERVER_MNEMONIC ADD CONSTRAINT SERVER_MNEMONIC_USER_FK2 FOREIGN KEY (UPDATED_BY) REFERENCES ZH_USER (ID)
/
ALTER TABLE SERVER_MNEMONIC ADD CONSTRAINT CKC_SERVER_MNEMONIC_IS_ACTIVE CHECK (IS_ACTIVE in ('Y','N','D'))
/
CREATE SEQUENCE SERVER_MNEMONIC_ID_SEQ START WITH 1 MINVALUE 1 INCREMENT BY 1
/