I want to forward engineer my er diagram to physical database.I have this error, I tried different ways to solve it but still no luck. Can someone Please help me. Here is the error message:
Executing SQL script in server ERROR: Error 1215: Cannot add foreign key constraint
SQL Code:
-- Table `mydb`.`Guest`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mydb`.`Guest` (
`Location` VARCHAR(45) NOT NULL,
`User_KexinM_Email` INT NOT NULL,
PRIMARY KEY (`User_KexinM_Email`),
CONSTRAINT `fk_Guest_User_KexinM1`
FOREIGN KEY (`User_KexinM_Email`)
REFERENCES `mydb`.`User_KexinM` (`Email`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
SQL script execution finished: statements: 6 succeeded, 1 failed
Fetching back view definitions in final form. Nothing to fetch