Lines 1-7
Link Here
|
1 |
$DBversion = 'XXX'; # will be replaced by RM |
1 |
$DBversion = 'XXX'; # will be replaced by RM |
2 |
if( CheckVersion( $DBversion ) ) { |
2 |
if( CheckVersion( $DBversion ) ) { |
3 |
$dbh->do( "ALTER TABLE collections_tracking ADD CONSTRAINT collections_tracking_ibfk_1 FOREIGN KEY (colId) REFERENCES collections (colId) ON DELETE CASCADE ON UPDATE CASCADE" ); $dbh->do( "ALTER TABLE collections_tracking ADD CONSTRAINT collections_tracking_ibfk_2 FOREIGN KEY (itemnumber) REFERENCES items (itemnumber) ON DELETE CASCADE ON UPDATE CASCADE" ); |
3 |
# Remove lines referencing non existing collections |
|
|
4 |
$dbh->do( "DELETE FROM collections_tracking WHERE colId NOT IN (SELECT colId FROM collections)" ); |
5 |
# Remove lines referencing non existing items |
6 |
$dbh->do( "DELETE FROM collections_tracking WHERE itemnumber NOT IN (SELECT itemnumber FROM items)" ); |
7 |
$dbh->do( "ALTER TABLE collections_tracking ADD CONSTRAINT collections_tracking_ibfk_1 FOREIGN KEY (colId) REFERENCES collections (colId) ON DELETE CASCADE ON UPDATE CASCADE" ); |
8 |
$dbh->do( "ALTER TABLE collections_tracking ADD CONSTRAINT collections_tracking_ibfk_2 FOREIGN KEY (itemnumber) REFERENCES items (itemnumber) ON DELETE CASCADE ON UPDATE CASCADE" ); |
4 |
|
9 |
|
5 |
SetVersion( $DBversion ); |
10 |
SetVersion( $DBversion ); |
6 |
print "Upgrade to $DBversion done (Bug XXXXX - Rotating collections objects)\n"; |
11 |
print "Upgrade to $DBversion done (Bug 18606 - Rotating collections objects)\n"; |
7 |
} |
12 |
} |
8 |
- |
|
|