Bug 26326: DBRev 21.06.00.042
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
ce2e85f56f
commit
f2febaeac4
2
Koha.pm
2
Koha.pm
|
|
@ -29,7 +29,7 @@ use vars qw{ $VERSION };
|
|||
# - #4 : the developer version. The 4th number is the database subversion.
|
||||
# used by developers when the database changes. updatedatabase take care of the changes itself
|
||||
# and is automatically called by Auth.pm when needed.
|
||||
$VERSION = "21.06.00.041";
|
||||
$VERSION = "21.06.00.042";
|
||||
|
||||
sub version {
|
||||
return $VERSION;
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
$DBversion = 'XXX';
|
||||
if( CheckVersion( $DBversion ) ) {
|
||||
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( "ALTER TABLE import_record_matches DROP PRIMARY KEY" );
|
||||
}
|
||||
$dbh->do( "ALTER TABLE import_record_matches ADD PRIMARY KEY (import_record_id,candidate_match_id)" );
|
||||
}
|
||||
|
||||
NewVersion( $DBversion, 26326, "Add primary key to import_record_matches");
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
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)
|
||||
|);
|
||||
}
|
||||
},
|
||||
}
|
||||
Loading…
Reference in New Issue