Bug 13766: DBRev 17.06.00.011

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2017-10-09 14:24:31 -03:00
parent 0152e95c97
commit 799293c40f
3 changed files with 23 additions and 22 deletions

View File

@ -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 = "17.06.00.010";
$VERSION = "17.06.00.011";
sub version {
return $VERSION;

View File

@ -1,21 +0,0 @@
$DBversion = "XXX";
if(CheckVersion($DBversion)) {
# Drop index that might exist because of bug 5337
if( index_exists('biblioitems', 'ean')) {
$dbh->do(q{ ALTER TABLE biblioitems DROP INDEX ean });
}
if( index_exists('deletedbiblioitems', 'ean')) {
$dbh->do(q{ ALTER TABLE deletedbiblioitems DROP INDEX ean });
}
# Change data type of column
$dbh->do(q{ ALTER TABLE biblioitems MODIFY COLUMN ean MEDIUMTEXT default NULL });
$dbh->do(q{ ALTER TABLE deletedbiblioitems MODIFY COLUMN ean MEDIUMTEXT default NULL });
# Add indexes
$dbh->do(q{ ALTER TABLE biblioitems ADD INDEX ean ( ean(255) )});
$dbh->do(q{ ALTER TABLE deletedbiblioitems ADD INDEX ean ( ean(255 ) )});
print "Upgrade to $DBversion done (Bug 13766 - Make ean mediumtext and add ean indexes)\n";
SetVersion($DBversion);
}

View File

@ -14686,6 +14686,28 @@ if ( CheckVersion($DBversion) ) {
print "Upgrade to $DBversion done (Bug 13912 - System preference for default place of publication (country code) for field 008, range 15-17)\n";
}
$DBversion = '17.06.00.011';
if ( CheckVersion($DBversion) ) {
# Drop index that might exist because of bug 5337
if( index_exists('biblioitems', 'ean')) {
$dbh->do(q{ ALTER TABLE biblioitems DROP INDEX ean });
}
if( index_exists('deletedbiblioitems', 'ean')) {
$dbh->do(q{ ALTER TABLE deletedbiblioitems DROP INDEX ean });
}
# Change data type of column
$dbh->do(q{ ALTER TABLE biblioitems MODIFY COLUMN ean MEDIUMTEXT default NULL });
$dbh->do(q{ ALTER TABLE deletedbiblioitems MODIFY COLUMN ean MEDIUMTEXT default NULL });
# Add indexes
$dbh->do(q{ ALTER TABLE biblioitems ADD INDEX ean ( ean(255) )});
$dbh->do(q{ ALTER TABLE deletedbiblioitems ADD INDEX ean ( ean(255 ) )});
SetVersion($DBversion);
print "Upgrade to $DBversion done (Bug 13766 - Make ean mediumtext and add ean indexes)\n";
}
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.