Jonathan Druart
943838ed99
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
18 lines
635 B
Perl
Executable file
18 lines
635 B
Perl
Executable file
use Modern::Perl;
|
|
|
|
return {
|
|
bug_number => "35610",
|
|
description => "Add FK on old_reserves.branchcode",
|
|
up => sub {
|
|
my ($args) = @_;
|
|
my ( $dbh, $out ) = @$args{qw(dbh out)};
|
|
|
|
unless ( foreign_key_exists('old_reserves', 'old_reserves_ibfk_branchcode') ) {
|
|
$dbh->do(q{
|
|
ALTER TABLE old_reserves
|
|
ADD CONSTRAINT `old_reserves_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE;
|
|
});
|
|
say $out "Added foreign key on 'old_reserves.branchcode'"
|
|
}
|
|
},
|
|
};
|