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

(-)a/installer/data/mysql/updatedatabase.pl (-1 / +11 lines)
Lines 17542-17547 if( CheckVersion( $DBversion ) ) { Link Here
17542
    }
17542
    }
17543
17543
17544
    if ( column_exists( 'issuingrules', 'maxissueqty' ) ) {
17544
    if ( column_exists( 'issuingrules', 'maxissueqty' ) ) {
17545
        # Cleaning invalid rules before, to avoid FK contraints to fail
17546
        $dbh->do(q|
17547
            DELETE FROM issuingrules WHERE categorycode != '*' AND categorycode NOT IN (SELECT categorycode FROM categories);
17548
        |);
17549
        $dbh->do(q|
17550
            DELETE FROM issuingrules WHERE branchcode != '*' AND branchcode NOT IN (SELECT branchcode FROM branches);
17551
        |);
17552
        $dbh->do(q|
17553
            DELETE FROM issuingrules WHERE itemtype != '*' AND itemtype NOT IN (SELECT itemtype FROM itemtypes);
17554
        |);
17555
17545
        $dbh->do("
17556
        $dbh->do("
17546
            INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
17557
            INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
17547
            SELECT IF(categorycode='*', NULL, categorycode),
17558
            SELECT IF(categorycode='*', NULL, categorycode),
17548
- 

Return to bug 23813