[SQL] CREATE TABLE IF NOT EXISTS 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 (shop_id
) REFERENCES tb_shop
(shop_id
)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
[Err] 1005 - Can’t create table ‘o2o.tb_product’ (errno: 121)
SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需
了解课程