Mysql 创建索引

-- 显示创表语句
show create table bsd_promotion_inventory_limit;

-- 显示表索引
show index from bsd_promotion_inventory_limit;

-- 删除索引
alter table bsd_promotion_inventory_limit DROP INDEX product_promotion_union_unique;

-- 创建组合唯一索引
alter table bsd_promotion_inventory_limit
add unique index indexName(product_id, promotion_id) comment '产品促销组合索引';

原文地址:https://www.cnblogs.com/cocoat/p/6632340.html