Bug 18235: DBRev 18.12.00.032
authorNick Clemens <nick@bywatersolutions.com>
Thu, 28 Mar 2019 15:41:22 +0000 (15:41 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 28 Mar 2019 15:41:38 +0000 (15:41 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Koha.pm
Koha/Schema/Result/SearchField.pm
installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index b37e7d3..d2e4379 100644 (file)
--- 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.12.00.031";
+$VERSION = "18.12.00.032";
 
 sub version {
     return $VERSION;
index 0f7d943..a347da0 100644 (file)
@@ -59,6 +59,13 @@ what type of data this holds, relevant when storing it in the search engine
   is_nullable: 1
   size: [5,2]
 
+=head2 facet_order
+
+  data_type: 'tinyint'
+  is_nullable: 1
+
+the order place of the field in facet list if faceted
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -78,6 +85,8 @@ __PACKAGE__->add_columns(
   },
   "weight",
   { data_type => "decimal", is_nullable => 1, size => [5, 2] },
+  "facet_order",
+  { data_type => "tinyint", is_nullable => 1 },
 );
 
 =head1 PRIMARY KEY
@@ -124,8 +133,8 @@ __PACKAGE__->has_many(
 );
 
 
-# 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
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-28 15:31:40
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4Hc7O2fMCses1Bgfmk6Anw
 
 __PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
 
diff --git a/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl b/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl
deleted file mode 100644 (file)
index c8e66b9..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-$DBversion = 'XXX'; # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    if( !column_exists( 'search_field', 'facet_order' ) ) {
-        $dbh->do("ALTER TABLE search_field ADD COLUMN facet_order TINYINT(4) DEFAULT NULL AFTER weight");
-    }
-
-    $dbh->do("UPDATE search_field SET facet_order=1 WHERE name='author'");
-    $dbh->do("UPDATE search_field SET facet_order=2 WHERE name='itype'");
-    $dbh->do("UPDATE search_field SET facet_order=3 WHERE name='location'");
-    $dbh->do("UPDATE search_field SET facet_order=4 WHERE name='su-geo'");
-    $dbh->do("UPDATE search_field SET facet_order=5 WHERE name='title-series'");
-    $dbh->do("UPDATE search_field SET facet_order=6 WHERE name='subject'");
-    $dbh->do("UPDATE search_field SET facet_order=7 WHERE name='ccode'");
-    $dbh->do("UPDATE search_field SET facet_order=8 WHERE name='holdingbranch'");
-    $dbh->do("UPDATE search_field SET facet_order=9 WHERE name='homebranch'");
-
-    # Always end with this (adjust the bug info)
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 18235 - Elastic search - make facets configurable)\n";
-}
index ab2711c..8a55175 100755 (executable)
@@ -17791,6 +17791,24 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 22008 - Add missing constraints for accountlines.manager_id)\n";
 }
 
+$DBversion = '18.12.00.032';
+if( CheckVersion( $DBversion ) ) {
+    if( !column_exists( 'search_field', 'facet_order' ) ) {
+        $dbh->do("ALTER TABLE search_field ADD COLUMN facet_order TINYINT(4) DEFAULT NULL AFTER weight");
+    }
+    $dbh->do("UPDATE search_field SET facet_order=1 WHERE name='author'");
+    $dbh->do("UPDATE search_field SET facet_order=2 WHERE name='itype'");
+    $dbh->do("UPDATE search_field SET facet_order=3 WHERE name='location'");
+    $dbh->do("UPDATE search_field SET facet_order=4 WHERE name='su-geo'");
+    $dbh->do("UPDATE search_field SET facet_order=5 WHERE name='title-series'");
+    $dbh->do("UPDATE search_field SET facet_order=6 WHERE name='subject'");
+    $dbh->do("UPDATE search_field SET facet_order=7 WHERE name='ccode'");
+    $dbh->do("UPDATE search_field SET facet_order=8 WHERE name='holdingbranch'");
+    $dbh->do("UPDATE search_field SET facet_order=9 WHERE name='homebranch'");
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 18235 - Elastic search - make facets configurable)\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.