Lines 1-12
Link Here
|
1 |
$DBversion = 'XXX'; # will be replaced by the RM |
1 |
$DBversion = 'XXX'; # will be replaced by the RM |
2 |
if( CheckVersion( $DBversion ) ) { |
2 |
if( CheckVersion( $DBversion ) ) { |
3 |
$dbh->do(q{ |
3 |
unless( foreign_key_exists( 'collections_tracking', 'collectionst_ibfk_1' ) ) { |
4 |
DELETE FROM collections_tracking WHERE colId NOT IN ( SELECT colId FROM collections ) |
4 |
$dbh->do(q{ |
5 |
}); |
5 |
DELETE FROM collections_tracking WHERE colId NOT IN ( SELECT colId FROM collections ) |
6 |
$dbh->do(q{ |
6 |
}); |
7 |
ALTER TABLE collections_tracking |
7 |
$dbh->do(q{ |
8 |
ADD CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE |
8 |
ALTER TABLE collections_tracking |
9 |
}); |
9 |
ADD CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE |
|
|
10 |
}); |
11 |
} |
10 |
|
12 |
|
11 |
NewVersion( $DBversion, 17202, "Add FK constraint for collection to collections_tracking"); |
13 |
NewVersion( $DBversion, 17202, "Add FK constraint for collection to collections_tracking"); |
12 |
} |
14 |
} |
13 |
- |
|
|