Lines 2-11
use Modern::Perl;
Link Here
|
2 |
|
2 |
|
3 |
return { |
3 |
return { |
4 |
bug_number => "29605", |
4 |
bug_number => "29605", |
5 |
description => "Add language_script_mapping primary key", |
5 |
description => "Resync DB structure for existing installations", |
6 |
up => sub { |
6 |
up => sub { |
7 |
my ($args) = @_; |
7 |
my ($args) = @_; |
8 |
my ($dbh) = @$args{qw(dbh)}; |
8 |
my ($dbh, $out) = @$args{qw(dbh out)}; |
9 |
|
9 |
|
10 |
if ( !primary_key_exists( 'language_script_mapping', 'language_subtag' ) |
10 |
if ( !primary_key_exists( 'language_script_mapping', 'language_subtag' ) |
11 |
and index_exists( 'language_script_mapping', 'language_subtag' ) ) { |
11 |
and index_exists( 'language_script_mapping', 'language_subtag' ) ) { |
Lines 22-27
return {
Link Here
|
22 |
ALTER TABLE language_script_mapping |
22 |
ALTER TABLE language_script_mapping |
23 |
ADD PRIMARY KEY `language_subtag` (`language_subtag`); |
23 |
ADD PRIMARY KEY `language_subtag` (`language_subtag`); |
24 |
}); |
24 |
}); |
|
|
25 |
|
26 |
say $out "Added missing primary key on language_script_mapping" |
25 |
} |
27 |
} |
|
|
28 |
|
29 |
unless ( foreign_key_exists('tmp_holdsqueue', 'tmp_holdsqueue_ibfk_3') ) { |
30 |
$dbh->do(q{ |
31 |
ALTER TABLE tmp_holdsqueue |
32 |
ADD CONSTRAINT `tmp_holdsqueue_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE |
33 |
}); |
34 |
|
35 |
say $out "Added missing foreign key on tmp_holdsqueue" |
36 |
} |
37 |
|
26 |
}, |
38 |
}, |
27 |
} |
39 |
} |