ALTER TABLE `commands`
    MODIFY COLUMN `ref_type` varchar(20) NOT NULL COMMENT '引用类型，DEVICE:设备；DEVICE_PRODUCT_CODE:设备类型' AFTER `id`;

ALTER TABLE `command_points`
    DROP COLUMN `device_id`;

update commands
set ref_type = 'DEVICE_PRODUCT_CODE',
    ref_id   = 4
where ref_type = 'DEVICE'
  and ref_id = 1;
update commands
set ref_type = 'DEVICE_PRODUCT_CODE',
    ref_id   = 6
where ref_type = 'DEVICE'
  and ref_id = 2;