我是MySQL工作台中的新手,当我尝试转换为Foward Engineering时,我得到了1064,这是我的脚本
实际上,我正在使用WorkBench 8.0 CE
错误:错误1064:您的SQL语法有错误;查看与您的MySQL服务器版本相对应的手册,以在'VISIBLE'附近使用正确的语法, 约束
fk_products_productlines
外键(第16行的“ productlines _”
SQL代码:
-- -----------------------------------------------------
-- Table `ventas`.`products`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `ventas`.`products` (
`productCode` VARCHAR(15) NOT NULL,
`productName` VARCHAR(70) NULL,
`productLine` VARCHAR(50) NULL,
`productScale` VARCHAR(10) NULL,
`productVendor` VARCHAR(50) NULL,
`productDescription` TEXT NULL,
`quantityInStock` SMALLINT(6) NULL,
`buyPrice` DOUBLE NULL,
`MSRP` DOUBLE NULL,
`productlines_productLine` VARCHAR(50) NOT NULL,
PRIMARY KEY (`productCode`),
INDEX `fk_products_productlines_idx` (`productlines_productLine` ASC) VISIBLE,
CONSTRAINT `fk_products_productlines`
FOREIGN KEY (`productlines_productLine`)
REFERENCES `ventas`.`productlines` (`productLine`)
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