我收到了这个错误:
CREATE TABLE `libro`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`autor_id` INTEGER(11),
`titulo` VARCHAR(255),
`paginas` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`),
INDEX `libro_FI_1` (`autor_id`),
CONSTRAINT `libro_FK_1`
FOREIGN KEY (`autor_id`)
REFERENCES `autor` (`id`)
)Type=InnoDB
[propel-sql-exec] SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Type=InnoDB' at line 12
有什么想法吗?
此致
哈维
答案 0 :(得分:5)
不应该是ENGINE=InnoDB
吗?
答案 1 :(得分:1)
使用ENGINE
代替Type
CREATE TABLE `libro`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`autor_id` INTEGER(11),
`titulo` VARCHAR(255),
`paginas` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`),
INDEX `libro_FI_1` (`autor_id`),
CONSTRAINT `libro_FK_1`
FOREIGN KEY (`autor_id`)
REFERENCES `autor` (`id`)
)ENGINE=InnoDB