create table tb_product( product_id int(100) NOT NULL AUTO_INCREMENT, product_name varchar(100) NOT NULL, product_desc varchar(2000) DEFAULT NULL, img_addr varchar(2000) DEFAULT ‘’, normal_price varchar(100) DEFAULT NULL, promotion_price varchar(100) DEFAULT NULL, priority int(2) NOT NULL DEFAULT ‘0’, create_time datetime DEFAULT NULL, last_edit_time datetime DEFAULT NULL, enable_status int(2) NOT NULL DEFAULT ‘0’, product_category_id int(11) DEFAULT NULL, shop_id int(20) NOT NULL DEFAULT ‘0’, PRIMARY KEY(product_id), CONSTRAINT fk_product_procate FOREIGN KEY(product_category_id) REFERENCES tb_product_category(product_category_id), CONSTRAINT fk_product_shop FOREIGN KEY (shops_id) REFERENCES tb_shop (shop_id) )ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=UTF8;这段sql出现了121错误,查询了是说外键重名了,但是我前面的命名都是跟老师的一样,是不是有个索引关节出问题了,请问怎么解决,换个外键名字说外键名不存在
SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需
了解课程