将 MySQL Workbench 5.2.33 与 MySQL 5.1.41 一起使用
我创建了一个 EER 图。但是当我尝试从 MySQL Workbench 对其进行正向工程时,我收到以下错误:
Executing SQL script in server
ERROR: Error 1005: Can't create table 'test_db.test_table' (errno: 150)
-- -------------------------------------------------------
Table `test_db`.`test_table`
-- -------------------------------------------------------
CREATE TABLE IF NOT EXISTS `test_db`.`test_table` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`figure` TINYINT UNSIGNED NULL ,
`users_id` BIGINT UNSIGNED NOT NULL ,
`inactive` TINYINT(1) NULL ,
`type_id` TINYINT NOT NULL ,
PRIMARY KEY (`id`, `users_id`, `type_id`) ,
UNIQUE INDEX `id_UNIQUE` (`id` ASC) ,
INDEX `fk_figure_users1` (`users_id` ASC) ,
INDEX `fk_figure_type1` (`figure_type_id` ASC) ,
CONSTRAINT `fk_figure_users1`
FOREIGN KEY (`users_id` )
REFERENCES `test_db`.`users` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_figure_type1`
FOREIGN KEY (`type_id` )
REFERENCES `test_db`.`type` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
SQL script execution finished: statements: 9 succeeded, 1 failed
为什么我会收到此错误?