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 |
- |
|
|