ALTER TABLE `wx_rent_contract`
ADD COLUMN `file_names` JSON NULL COMMENT '合同支持多文件' AFTER `fix_end_date`;

update wx_rent_contract set file_names=CONCAT('[{\"filename\":\"',`filename`,'\",\"filepath\":\"',`filepath`,'\"}]')
where filename is not null or LENGTH(`filename`) >0;

update wx_rent_contract set file_names=CONCAT('[]') where filename is null or LENGTH(`filename`)=0 ;


ALTER TABLE `wx_property_contract`
ADD COLUMN `file_names` JSON NULL COMMENT '合同支持多文件';

update wx_property_contract set file_names=CONCAT('[{\"filename\":\"',`filename`,'\",\"filepath\":\"',`filepath`,'\"}]')
where filename is not null or LENGTH(`filename`) >0;

update wx_property_contract set file_names=CONCAT('[]') where filename is null or LENGTH(`filename`)=0 ;



