Bug 36978: (Bug 34029 follow-up) Make update idempotent
The update wasn't checking for index pre-existance and as such could fail in certain cases. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
900a1aecbb
commit
1daccb71be
|
|
@ -21,13 +21,10 @@ return {
|
|||
);
|
||||
say $out "Updated deletedbiblioitems.place to text";
|
||||
|
||||
$dbh->do(
|
||||
q{
|
||||
ALTER TABLE `biblioitems`
|
||||
DROP INDEX `publishercode`
|
||||
if ( index_exists( 'biblioitems', 'publishercode' ) ) {
|
||||
$dbh->do(q{ALTER TABLE `biblioitems` DROP INDEX `publishercode`});
|
||||
say $out "Remove index on biblioitems.publishercode";
|
||||
}
|
||||
);
|
||||
say $out "Remove index on biblioitems.publishercode";
|
||||
$dbh->do(
|
||||
q{
|
||||
ALTER TABLE `biblioitems`
|
||||
|
|
@ -35,20 +32,14 @@ return {
|
|||
}
|
||||
);
|
||||
say $out "Updated biblioitems.publishercode to text";
|
||||
$dbh->do(
|
||||
q{
|
||||
ALTER TABLE `biblioitems`
|
||||
ADD INDEX `publishercode` (`publishercode`(191))
|
||||
}
|
||||
);
|
||||
|
||||
$dbh->do(q{ALTER TABLE `biblioitems` ADD INDEX `publishercode` (`publishercode`(191))});
|
||||
say $out "Create index on biblioitems.publishercode";
|
||||
$dbh->do(
|
||||
q{
|
||||
ALTER TABLE `deletedbiblioitems`
|
||||
DROP INDEX `publishercode`
|
||||
|
||||
if ( index_exists( 'deletedbiblioitems', 'publishercode' ) ) {
|
||||
$dbh->do(q{ALTER TABLE `deletedbiblioitems` DROP INDEX `publishercode`});
|
||||
say $out "Remove index on deletedbiblioitems.publishercode";
|
||||
}
|
||||
);
|
||||
say $out "Remove index on deletedbiblioitems.publishercode";
|
||||
$dbh->do(
|
||||
q{
|
||||
ALTER TABLE `deletedbiblioitems`
|
||||
|
|
|
|||
Loading…
Reference in New Issue