 ENGINE = InnoDB
 DEFAULT CHARACTER SET = utf8;
 
-CREATE UNIQUE INDEX `CMP_UID_UNIQUE` ON `calordersdb`.`DEPARTMENT` (`DEP_UID` ASC);
+CREATE UNIQUE INDEX `DEP_UID_UNIQUE` ON `calordersdb`.`DEPARTMENT` (`DEP_UID` ASC);
 
 
 -- -----------------------------------------------------

  `UPDATE_USER_ID` VARCHAR(32) NOT NULL,
  `UPDATE_TS` DATETIME NOT NULL,
  PRIMARY KEY (`ADR_UID`),
  CONSTRAINT `fk_ADDRESS_COMPANY1`
    FOREIGN KEY (`DEP_UID_FK`)
    REFERENCES `calordersdb`.`DEPARTMENT` (`DEP_UID`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_ADDRESS_EMPLOYEES1`
    FOREIGN KEY (`PTY_UID_FK`)
    REFERENCES `calordersdb`.`PARTY` (`PTY_UID`)
    ON DELETE NO ACTION


CREATE UNIQUE INDEX `GRE_UID_UNIQUE` ON `calordersdb`.`GROUP_PARTY_ASSOC` (`GRE_UID` ASC);

CREATE INDEX `fk_GROUP_PARTY_ASSOC_PARTYS1_idx` ON `calordersdb`.`GROUP_PARTY_ASSOC` (`PTY_UID_FK` ASC);

CREATE INDEX `fk_GROUP_PARTY_ASSOC_GROUPS1_idx` ON `calordersdb`.`GROUP_PARTY_ASSOC` (`GRP_UID_FK` ASC);


SET SQL_MODE=@OLD_SQL_MODE;
