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

(-)a/installer/data/mysql/updatedatabase.pl (-8 / +4 lines)
Lines 10802-10816 if ( CheckVersion($DBversion) ) { Link Here
10802
        WHERE course_items.ci_id IS NULL
10802
        WHERE course_items.ci_id IS NULL
10803
    });
10803
    });
10804
    my $dbconfigured = C4::Context->config("database");
10804
    my $dbconfigured = C4::Context->config("database");
10805
    my $count_course_reserves_ibfk_2 = $dbh->selectrow_arrayref(qq|
10805
    my @row;
10806
        SELECT COUNT(*)
10806
    @row = $dbh->selectrow_arrayref(qq|
10807
        FROM information_schema.table_constraints
10807
        SHOW INDEXES FROM course_reserves WHERE key_name='course_reserves_ibfk_2'
10808
        WHERE  table_schema = '$dbconfigured'
10809
               AND table_name = 'course_reserves'
10810
               AND CONSTRAINT_NAME = 'course_reserves_ibfk_2'
10811
    |);
10808
    |);
10812
    #Add fk only if not present
10809
    #Add fk only if not present
10813
    if ( $count_course_reserves_ibfk_2-->[0] == 0) {
10810
    unless ( @row ) {
10814
        $dbh->do(q{
10811
        $dbh->do(q{
10815
            ALTER IGNORE TABLE course_reserves
10812
            ALTER IGNORE TABLE course_reserves
10816
                add CONSTRAINT course_reserves_ibfk_2
10813
                add CONSTRAINT course_reserves_ibfk_2
10817
- 

Return to bug 15207