-- IotCardImportTask 表添加 carrier_name 冗余字段（已有 carrier_type）

ALTER TABLE tb_iot_card_import_task ADD COLUMN carrier_name VARCHAR(100);

COMMENT ON COLUMN tb_iot_card_import_task.carrier_name IS '运营商名称，创建任务时快照';

-- 从 Carrier 表填充现有数据
UPDATE tb_iot_card_import_task 
SET carrier_name = c.carrier_name
FROM tb_carrier c 
WHERE tb_iot_card_import_task.carrier_id = c.id;
