This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
carwash_order/update_vip_index.sql
T
wsh5485 f173149e28 feat(数据库): 修改VIP客户表索引为手机号和车牌号组合唯一
移除phone字段的唯一约束,添加phone和car_number的复合唯一索引
更新相关SQL脚本和PHP代码以支持新的索引规则
2025-11-20 10:55:59 +08:00

11 lines
372 B
SQL

-- 更新VIP客户表的索引结构
USE carwash_booking;
-- 1. 移除phone字段的UNIQUE约束(需要先删除原索引)
ALTER TABLE vip_customers DROP INDEX phone;
-- 2. 添加phone和car_number的复合唯一索引
ALTER TABLE vip_customers ADD UNIQUE INDEX idx_phone_car_number (phone, car_number);
-- 3. 验证索引添加成功
SHOW INDEX FROM vip_customers;