DROP TABLE IF EXISTS `taikaDB`.`ADDRESS` ;
CREATE TABLE IF NOT EXISTS `taikaDB`.`ADDRESS` ( `addressId` INT(11) NOT NULL , `name` VARCHAR(45) NULL , `address1` VARCHAR(45) NULL COMMENT ' ' , `address2` VARCHAR(45) NULL , `zip` VARCHAR(45) NULL , `city` VARCHAR(45) NULL , `country` VARCHAR(45) NULL , PRIMARY KEY (`addressId`) ) ENGINE = InnoDB;
-- ----------------------------------------------------- -- Table `taikaDB`.`EMAIL` -- ----------------------------------------------------- DROP TABLE IF EXISTS `taikaDB`.`EMAIL` ;
CREATE TABLE IF NOT EXISTS `taikaDB`.`EMAIL` ( `emailAddress` VARCHAR(45) NOT NULL , `ADDRESS_addressId` INT(11) NOT NULL , `type` INT(11) NULL , PRIMARY KEY (`emailAddress`, `ADDRESS_addressId`) , INDEX `fk_EMAIL_ADDRESS1` (`ADDRESS_addressId` ASC) , CONSTRAINT `fk_EMAIL_ADDRESS1` FOREIGN KEY (`ADDRESS_addressId` ) REFERENCES `taikaDB`.`ADDRESS` (`addressId` ) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB;
-- ----------------------------------------------------- -- Table `taikaDB`.`COMPANY` -- ----------------------------------------------------- DROP TABLE IF EXISTS `taikaDB`.`COMPANY` ;
CREATE TABLE IF NOT EXISTS `taikaDB`.`COMPANY` ( `companyID` INT(11) NOT NULL , `ADDRESS_addressId` INT(11) NOT NULL , PRIMARY KEY (`companyID`) , INDEX `fk_COMPANY_ADDRESS1` (`ADDRESS_addressId` ASC) , CONSTRAINT `fk_COMPANY_ADDRESS1` FOREIGN KEY (`ADDRESS_addressId` ) REFERENCES `taikaDB`.`ADDRESS` (`addressId` ) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB;
-- ----------------------------------------------------- -- Table `taikaDB`.`BRANCH` -- ----------------------------------------------------- DROP TABLE IF EXISTS `taikaDB`.`BRANCH` ;
CREATE TABLE IF NOT EXISTS `taikaDB`.`BRANCH` ( `branchId` INT(11) NOT NULL , `COMPANY_companyID` INT(11) NOT NULL , PRIMARY KEY (`branchId`, `COMPANY_companyID`) , INDEX `fk_BRANCH_COMPANY1` (`COMPANY_companyID` ASC) , CONSTRAINT `fk_BRANCH_COMPANY1` FOREIGN KEY (`COMPANY_companyID` ) REFERENCES `taikaDB`.`COMPANY` (`companyID` ) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB;
|