tumobi / nideshop

NideShop 开源微信小程序商城服务端 API(Node.js + ThinkJS)
https://www.nideshop.com/
MIT License
5.57k stars 1.79k forks source link

Incorrect table definition; there can be only one auto column and it must be defined as a key #39

Closed xbhuang1994 closed 6 years ago

xbhuang1994 commented 6 years ago

错误 SQL 查询:

CREATE TABLE nideshop_keywords ( keyword varchar(90) NOT NULL DEFAULT '', is_hot tinyint(1) unsigned NOT NULL DEFAULT '0', is_default tinyint(1) unsigned NOT NULL DEFAULT '0', is_show tinyint(1) unsigned NOT NULL DEFAULT '1', sort_order int(11) unsigned NOT NULL DEFAULT '100', scheme _url varchar(255) NOT NULL DEFAULT '' COMMENT '关键词的跳转链接', id int(11) NOT NULL AUTO_INCREMENT, type int(11) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (keyword,id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='热闹关键词表' MySQL 返回: 文档

1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key

xbhuang1994 commented 6 years ago

id 与 keyword 替换一个位置就解决了此问题