-- 回滚：jsonb 数组 → varchar(500)，取第一个元素；空数组 → ''
ALTER TABLE tb_order
    ALTER COLUMN payment_voucher_key TYPE varchar(500)
        USING COALESCE(payment_voucher_key->>0, '');

ALTER TABLE tb_refund_request
    ALTER COLUMN refund_voucher_key TYPE varchar(500)
        USING COALESCE(refund_voucher_key->>0, '');

ALTER TABLE tb_agent_recharge_record
    ALTER COLUMN payment_voucher_key TYPE varchar(500)
        USING COALESCE(payment_voucher_key->>0, '');

ALTER TABLE tb_agent_recharge_record DROP COLUMN IF EXISTS remark;
