Koha/installer/data/mysql/db_revs/210600042.pl
Jonathan Druart fac962413e Bug 26326: Add missing +x flag
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-04 10:38:54 +01:00

23 lines
748 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => "26326",
description => "Add primary key to import_record_matches",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
unless(
primary_key_exists('import_record_matches','import_record_id') &&
primary_key_exists('import_record_matches','candidate_match_id')
){
if( primary_key_exists('import_record_matches' ) ){
$dbh->do(q|
ALTER TABLE import_record_matches DROP PRIMARY KEY
|);
}
$dbh->do(q|
ALTER TABLE import_record_matches ADD PRIMARY KEY (import_record_id,candidate_match_id)
|);
}
},
}