ALTER TABLE `mallink`.`wx_legion_activity_order`
ADD COLUMN `cus_merchant_id` bigint NULL AFTER `cus_address`,
ADD COLUMN `cus_legion_id` bigint NULL AFTER `cus_merchant_id`,
ADD COLUMN `cus_union_id` bigint NULL AFTER `cus_legion_id`;


update wx_legion_activity_order o
    left join  wx_legion_activity_user u on o.cus_id = u.id
    set o.cus_merchant_id = u.merchant_id,o.cus_legion_id = u.legion_id,o.cus_union_id = u.union_id;


ALTER TABLE `mallink`.`wx_legion_activity_order`
    MODIFY COLUMN `cus_merchant_id` bigint(20) NOT NULL AFTER `cus_address`,
    MODIFY COLUMN `cus_legion_id` bigint(20) NOT NULL AFTER `cus_merchant_id`,
    MODIFY COLUMN `cus_union_id` bigint(20) NOT NULL AFTER `cus_legion_id`;
