From 07526d897a566c082860120c721bc1c610a24e48 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 7 Nov 2018 23:08:03 +0000 Subject: [PATCH] Bug 18316: DBRev 18.06.00.054 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- Koha/Schema/Result/SearchField.pm | 12 ++++++++++-- .../atomicupdate/bug_18316_add-weight-column.perl | 9 --------- installer/data/mysql/updatedatabase.pl | 9 +++++++++ 4 files changed, 20 insertions(+), 12 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_18316_add-weight-column.perl diff --git a/Koha.pm b/Koha.pm index 6d7b03994e..6a739e536c 100644 --- a/Koha.pm +++ b/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 = "18.06.00.053"; +$VERSION = "18.06.00.054"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/SearchField.pm b/Koha/Schema/Result/SearchField.pm index 95dab9d54a..0f7d943164 100644 --- a/Koha/Schema/Result/SearchField.pm +++ b/Koha/Schema/Result/SearchField.pm @@ -53,6 +53,12 @@ the human readable name of the field, for display what type of data this holds, relevant when storing it in the search engine +=head2 weight + + data_type: 'decimal' + is_nullable: 1 + size: [5,2] + =cut __PACKAGE__->add_columns( @@ -70,6 +76,8 @@ __PACKAGE__->add_columns( }, is_nullable => 0, }, + "weight", + { data_type => "decimal", is_nullable => 1, size => [5, 2] }, ); =head1 PRIMARY KEY @@ -116,8 +124,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-06-27 04:12:00 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:axyQNupqtw+5gMh1rsIHAg +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2018-11-07 22:22:22 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4Q+IXwF0hViF8+kpR96eLA __PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map"); diff --git a/installer/data/mysql/atomicupdate/bug_18316_add-weight-column.perl b/installer/data/mysql/atomicupdate/bug_18316_add-weight-column.perl deleted file mode 100644 index 7e6710e719..0000000000 --- a/installer/data/mysql/atomicupdate/bug_18316_add-weight-column.perl +++ /dev/null @@ -1,9 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - if( !column_exists( 'search_field', 'weight' ) ) { - $dbh->do( "ALTER TABLE `search_field` ADD COLUMN `weight` decimal(5,2) DEFAULT NULL AFTER `type`" ); - } - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 18316 - Add column search_field.weight)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 0746afdeca..67bea640a1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -16916,6 +16916,15 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 15494 - Block renewals by arbitrary item values)\n"; } +$DBversion = '18.06.00.054'; +if( CheckVersion( $DBversion ) ) { + if( !column_exists( 'search_field', 'weight' ) ) { + $dbh->do( "ALTER TABLE `search_field` ADD COLUMN `weight` decimal(5,2) DEFAULT NULL AFTER `type`" ); + } + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 18316 - Add column search_field.weight)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.2