fix upgrade for dangling cust_main_invoice, RT#75271