Cita:
Asi como lo genera MySQL WORKBENCH da error....... y se que son las claves foraneas el problema porque cuando las quito ... no hay error:CREATE TABLE IF NOT EXISTS `mydb`.`reviews` (
`id_review` INT(11) NOT NULL AUTO_INCREMENT ,
`id_user_blogger` INT(11) NULL DEFAULT NULL ,
`id_user_reviewer` INT(11) NULL DEFAULT NULL ,
`id_assignament` INT(11) NOT NULL ,
`title` VARCHAR(45) NOT NULL ,
`body` VARCHAR(45) NOT NULL ,
`keywords` VARCHAR(45) NOT NULL ,
`date_submision_by_sponsor` DATETIME NULL DEFAULT NULL ,
`date_assign` DATETIME NULL DEFAULT NULL ,
`date_submision_by_blogger` VARCHAR(45) NULL DEFAULT NULL ,
`date_review` DATETIME NULL DEFAULT NULL ,
`aproval` TINYINT(1) NOT NULL DEFAULT 0 ,
`date_system` DATETIME NOT NULL ,
PRIMARY KEY (`id_review`) ,
INDEX `fk_reviews_users2` (`id_user_blogger` ASC) ,
INDEX `fk_reviews_users3` (`id_user_reviewer` ASC) ,
INDEX `fk_reviews_assignaments1` (`id_assignament` ASC) ,
CONSTRAINT `fk_reviews_users2`
FOREIGN KEY (`id_user_blogger` )
REFERENCES `mydb`.`users` (`id_user` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_reviews_users3`
FOREIGN KEY (`id_user_reviewer` )
REFERENCES `mydb`.`users` (`id_user` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_reviews_assignaments1`
FOREIGN KEY (`id_assignament` )
REFERENCES `mydb`.`assignaments` (`id_assignament` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci
COMMENT = 'los articulos';
`id_review` INT(11) NOT NULL AUTO_INCREMENT ,
`id_user_blogger` INT(11) NULL DEFAULT NULL ,
`id_user_reviewer` INT(11) NULL DEFAULT NULL ,
`id_assignament` INT(11) NOT NULL ,
`title` VARCHAR(45) NOT NULL ,
`body` VARCHAR(45) NOT NULL ,
`keywords` VARCHAR(45) NOT NULL ,
`date_submision_by_sponsor` DATETIME NULL DEFAULT NULL ,
`date_assign` DATETIME NULL DEFAULT NULL ,
`date_submision_by_blogger` VARCHAR(45) NULL DEFAULT NULL ,
`date_review` DATETIME NULL DEFAULT NULL ,
`aproval` TINYINT(1) NOT NULL DEFAULT 0 ,
`date_system` DATETIME NOT NULL ,
PRIMARY KEY (`id_review`) ,
INDEX `fk_reviews_users2` (`id_user_blogger` ASC) ,
INDEX `fk_reviews_users3` (`id_user_reviewer` ASC) ,
INDEX `fk_reviews_assignaments1` (`id_assignament` ASC) ,
CONSTRAINT `fk_reviews_users2`
FOREIGN KEY (`id_user_blogger` )
REFERENCES `mydb`.`users` (`id_user` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_reviews_users3`
FOREIGN KEY (`id_user_reviewer` )
REFERENCES `mydb`.`users` (`id_user` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_reviews_assignaments1`
FOREIGN KEY (`id_assignament` )
REFERENCES `mydb`.`assignaments` (`id_assignament` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci
COMMENT = 'los articulos';
Cita:
Idea de que esta mal ? CREATE TABLE IF NOT EXISTS `mydb`.`reviews` (
`id_review` INT(11) NOT NULL AUTO_INCREMENT ,
`id_user_blogger` INT(11) NULL DEFAULT NULL ,
`id_user_reviewer` INT(11) NULL DEFAULT NULL ,
`id_assignament` INT(11) NOT NULL ,
`title` VARCHAR(45) NOT NULL ,
`body` VARCHAR(45) NOT NULL ,
`keywords` VARCHAR(45) NOT NULL ,
`date_submision_by_sponsor` DATETIME NULL DEFAULT NULL ,
`date_assign` DATETIME NULL DEFAULT NULL ,
`date_submision_by_blogger` VARCHAR(45) NULL DEFAULT NULL ,
`date_review` DATETIME NULL DEFAULT NULL ,
`aproval` TINYINT(1) NOT NULL DEFAULT 0 ,
`date_system` DATETIME NOT NULL ,
PRIMARY KEY (`id_review`) ,
INDEX `fk_reviews_users2` (`id_user_blogger` ASC) ,
INDEX `fk_reviews_users3` (`id_user_reviewer` ASC) ,
INDEX `fk_reviews_assignaments1` (`id_assignament` ASC)
) ENGINE = INNODB DEFAULT CHARACTER SET = utf8 COMMENT = '';
`id_review` INT(11) NOT NULL AUTO_INCREMENT ,
`id_user_blogger` INT(11) NULL DEFAULT NULL ,
`id_user_reviewer` INT(11) NULL DEFAULT NULL ,
`id_assignament` INT(11) NOT NULL ,
`title` VARCHAR(45) NOT NULL ,
`body` VARCHAR(45) NOT NULL ,
`keywords` VARCHAR(45) NOT NULL ,
`date_submision_by_sponsor` DATETIME NULL DEFAULT NULL ,
`date_assign` DATETIME NULL DEFAULT NULL ,
`date_submision_by_blogger` VARCHAR(45) NULL DEFAULT NULL ,
`date_review` DATETIME NULL DEFAULT NULL ,
`aproval` TINYINT(1) NOT NULL DEFAULT 0 ,
`date_system` DATETIME NOT NULL ,
PRIMARY KEY (`id_review`) ,
INDEX `fk_reviews_users2` (`id_user_blogger` ASC) ,
INDEX `fk_reviews_users3` (`id_user_reviewer` ASC) ,
INDEX `fk_reviews_assignaments1` (`id_assignament` ASC)
) ENGINE = INNODB DEFAULT CHARACTER SET = utf8 COMMENT = '';
GRACIAS!