View | Details | Raw Unified | Return to bug 9303
Collapse All | Expand All

(-)a/installer/data/mysql/updatedatabase.pl (-1 / +11 lines)
Lines 37-42 use Getopt::Long; Link Here
37
use C4::Context;
37
use C4::Context;
38
use C4::Installer;
38
use C4::Installer;
39
use C4::Dates;
39
use C4::Dates;
40
use Koha::Database;
40
41
41
use MARC::Record;
42
use MARC::Record;
42
use MARC::File::XML ( BinaryEncoding => 'utf8' );
43
use MARC::File::XML ( BinaryEncoding => 'utf8' );
Lines 8219-8224 if(CheckVersion($DBversion)) { Link Here
8219
    $dbh->do(qq{
8220
    $dbh->do(qq{
8220
        UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC
8221
        UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC
8221
    });
8222
    });
8223
8224
    my $schema = Koha::Database->new()->schema();
8225
    my $max_issue_id = $schema->resultset('Issue')->get_column('issue_id')->max();
8226
    $max_issue_id ||= $schema->resultset('OldIssue')->get_column('issue_id')->max();
8227
    $max_issue_id ||= 0;
8228
    $max_issue_id++;
8229
    $dbh->do(qq{
8230
        ALTER TABLE issues AUTO_INCREMENT = $max_issue_id
8231
    });
8232
8222
    print "Upgrade to $DBversion done (Bug 9303 - relative's checkouts in the opac)\n";
8233
    print "Upgrade to $DBversion done (Bug 9303 - relative's checkouts in the opac)\n";
8223
    SetVersion($DBversion);
8234
    SetVersion($DBversion);
8224
}
8235
}
8225
- 

Return to bug 9303