ALTER TABLE `dashboard_realtime_accumulate_day`
    ADD COLUMN attr_code VARCHAR(50) DEFAULT 'single' COMMENT '一个属性的设备默认single，多属性的比如温湿度，则对应温度[temperature]，湿度[humidity]' AFTER device_id,
    DROP INDEX uniq_device_date,
    ADD UNIQUE INDEX uniq_device_attr_date(device_id, attr_code, date_year, date_month, date_day);

ALTER TABLE `dashboard_record_accumulate`
    ADD COLUMN attr_code VARCHAR(50) DEFAULT 'single' COMMENT '一个属性的设备默认single，多属性的比如温湿度，则对应温度[temperature]，湿度[humidity]' AFTER device_id,
    ADD INDEX idx_device_attr_date(device_id, attr_code, date_year, date_month, date_day);
    
ALTER TABLE dashboard_realtime_measure 
    DROP PRIMARY KEY,
    ADD COLUMN attr_code VARCHAR(50) DEFAULT 'single' COMMENT '一个属性的设备默认single，多属性的比如温湿度，则对应温度[temperature]，湿度[humidity]' AFTER device_id,
    ADD UNIQUE INDEX (device_id, attr_code);
    
ALTER TABLE dashboard_record_measure
    ADD COLUMN attr_code VARCHAR(50) DEFAULT 'single' COMMENT '一个属性的设备默认single，多属性的比如温湿度，则对应温度[temperature]，湿度[humidity]' AFTER device_id,
    ADD INDEX idx_device_attr_date (device_id, attr_code, date_year, date_month, date_day);

