Lines 8-13
return {
Link Here
|
8 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
8 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
9 |
|
9 |
|
10 |
unless ( foreign_key_exists('old_reserves', 'old_reserves_ibfk_branchcode') ) { |
10 |
unless ( foreign_key_exists('old_reserves', 'old_reserves_ibfk_branchcode') ) { |
|
|
11 |
$dbh->do(q{ |
12 |
UPDATE old_reserves |
13 |
SET branchcode = NULL |
14 |
WHERE branchcode NOT IN (SELECT branchcode FROM branches) |
15 |
}); |
16 |
|
11 |
$dbh->do(q{ |
17 |
$dbh->do(q{ |
12 |
ALTER TABLE old_reserves |
18 |
ALTER TABLE old_reserves |
13 |
ADD CONSTRAINT `old_reserves_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE; |
19 |
ADD CONSTRAINT `old_reserves_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE; |
14 |
- |
|
|