一人多车
This commit is contained in:
14
sql/alter_hot_driver_vehicle_ids_20260522.sql
Normal file
14
sql/alter_hot_driver_vehicle_ids_20260522.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
ALTER TABLE hot_driver
|
||||
ADD COLUMN vehicle_ids VARCHAR(1000) NULL COMMENT '已绑定车辆ID集合,多个以逗号分隔' AFTER vehicle_id;
|
||||
|
||||
UPDATE hot_driver
|
||||
SET vehicle_ids = NULLIF(TRIM(vehicle_id), '')
|
||||
WHERE vehicle_ids IS NULL
|
||||
AND vehicle_id IS NOT NULL;
|
||||
|
||||
UPDATE hot_driver
|
||||
SET vehicle_id = NULLIF(SUBSTRING_INDEX(vehicle_ids, ',', 1), ''),
|
||||
plate_number = NULLIF(SUBSTRING_INDEX(plate_number, ',', 1), '');
|
||||
|
||||
ALTER TABLE hot_driver
|
||||
DROP COLUMN current_page_vehicle_id;
|
||||
Reference in New Issue
Block a user