Lines 21703-21708
if( CheckVersion( $DBversion ) ) {
Link Here
|
21703 |
|
21703 |
|
21704 |
unless ( foreign_key_exists( 'serial', 'serial_ibfk_1' ) ) { |
21704 |
unless ( foreign_key_exists( 'serial', 'serial_ibfk_1' ) ) { |
21705 |
my $serials = $dbh->selectall_arrayref(q| |
21705 |
my $serials = $dbh->selectall_arrayref(q| |
|
|
21706 |
SELECT serialid FROM serial JOIN subscription USING (subscriptionid) WHERE serial.biblionumber != subscription.biblionumber |
21707 |
|, { Slice => {} }); |
21708 |
if ( @$serials ) { |
21709 |
push @warnings, q|WARNING - The following serials will be updated, they were attached to a different biblionumber than their related subscription: | . join ", ", map { $_->{serialid} } @$serials; |
21710 |
$dbh->do(q| |
21711 |
UPDATE serial JOIN subscription USING (subcriptionid) SET serial.biblionumber = subscription.biblionumber WHERE serial.biblionumber != subscription.biblionumber |
21712 |
|); |
21713 |
} |
21714 |
$serials = $dbh->selectall_arrayref(q| |
21706 |
SELECT serialid FROM serial WHERE biblionumber NOT IN (SELECT biblionumber FROM biblio) |
21715 |
SELECT serialid FROM serial WHERE biblionumber NOT IN (SELECT biblionumber FROM biblio) |
21707 |
|, { Slice => {} }); |
21716 |
|, { Slice => {} }); |
21708 |
if ( @$serials ) { |
21717 |
if ( @$serials ) { |
Lines 21745-21750
if( CheckVersion( $DBversion ) ) {
Link Here
|
21745 |
|); |
21754 |
|); |
21746 |
|
21755 |
|
21747 |
unless ( foreign_key_exists( 'subscriptionhistory', 'subscription_history_ibfk_1' ) ) { |
21756 |
unless ( foreign_key_exists( 'subscriptionhistory', 'subscription_history_ibfk_1' ) ) { |
|
|
21757 |
$dbh->do(q| |
21758 |
UPDATE subscriptionhistory JOIN subscription USING (subcriptionid) SET subscriptionhistory.biblionumber = subscription.biblionumber WHERE subscriptionhistory.biblionumber != subscription.biblionumber |
21759 |
|); |
21748 |
$dbh->do(q| |
21760 |
$dbh->do(q| |
21749 |
DELETE FROM subscriptionhistory WHERE biblionumber NOT IN (SELECT biblionumber FROM biblio) |
21761 |
DELETE FROM subscriptionhistory WHERE biblionumber NOT IN (SELECT biblionumber FROM biblio) |
21750 |
|); |
21762 |
|); |
21751 |
- |
|
|