In C4::serials a few queries use queries of the form SELECT subscription.*, subscriptionhistory.* FROM subscription LEFT JOIN subscriptionhisotry USING(subscriptionid) If there are is a subscription without a matching subscriptionhistory then this join results in subscription.subscriptionid | subscriptionhistory.subscriptionid ---------------------------------------------------------------- 1234 | NULL Once this is fetched and squashed in to a hashref (for example, via fetchall_arrayref) this will be { subscriptionid => undef } This implicitly requires that every subscription has a matching subscriptionhistory. If we change the subscriptionhistory.* to select only the parts we need then we can avoid this issue. For SearchSubscription (which is only used by serials/serials-search.pl) none of the columns from subscriptionhistory appear to be used. We could also add a 'subscription.subscriptionid' to the end of the select, but this seems less clean.
When looking at the table structure for subscriptions for a migration I realized that you always need to set all the tables in order to have a working and adjustable subscription: subscription, subsriptionhistory and also a first serial - I wonder if this wouldn't be more of a data issue?