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

(-)a/installer/data/mysql/updatedatabase.pl (-2 / +3 lines)
Lines 17809-17816 if( CheckVersion( $DBversion ) ) { Link Here
17809
    }
17809
    }
17810
17810
17811
    # Rename accountlines_ibfk_2 to accountlines_ibfk_items
17811
    # Rename accountlines_ibfk_2 to accountlines_ibfk_items
17812
    if ( foreign_key_exists( 'accountlines', 'accountlines_ibfk_2' ) && !foreign_key_exists( 'accountlines', 'accountlines_ibfk_items' ) ) {
17812
    if ( foreign_key_exists( 'accountlines', 'accountlines_ibfk_2' ) ) {
17813
        $dbh->do("ALTER TABLE accountlines DROP FOREIGN KEY accountlines_ibfk_2");
17813
        $dbh->do("ALTER TABLE accountlines DROP FOREIGN KEY accountlines_ibfk_2");
17814
    }
17815
    unless ( foreign_key_exists( 'accountlines', 'accountlines_ibfk_items' ) ) {
17814
        $dbh->do("ALTER TABLE accountlines ADD CONSTRAINT `accountlines_ibfk_items` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE");
17816
        $dbh->do("ALTER TABLE accountlines ADD CONSTRAINT `accountlines_ibfk_items` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE");
17815
    }
17817
    }
17816
17818
17817
- 

Return to bug 24658