Bug 22024: DBRev 18.11.00.003
authorNick Clemens <nick@bywatersolutions.com>
Wed, 19 Dec 2018 16:31:25 +0000 (16:31 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 20 Dec 2018 09:57:34 +0000 (09:57 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f56dd2e829569cf40157347640fdcb203890e757)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Koha.pm
installer/data/mysql/atomicupdate/bug_22024-splitting-rules.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 3e1c98b..49b8495 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.11.00.002";
+$VERSION = "18.11.00.003";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_22024-splitting-rules.perl b/installer/data/mysql/atomicupdate/bug_22024-splitting-rules.perl
deleted file mode 100644 (file)
index 398671f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-
-
-    # On a new installation the class_sources.sql will have failed, so we need to add all missing data
-
-    my( $sort_cnt ) = $dbh->selectrow_array( q|SELECT COUNT(*) FROM class_sort_rules|);
-    if( !$sort_cnt ) {
-        $dbh->do(q|INSERT INTO `class_sort_rules` (`class_sort_rule`, `description`, `sort_routine`) VALUES
-                               ('dewey', 'Default filing rules for DDC', 'Dewey'),
-                               ('lcc', 'Default filing rules for LCC', 'LCC'),
-                               ('generic', 'Generic call number filing rules', 'Generic')
-            |);
-    }
-
-    my ( $split_cnt ) = $dbh->selectrow_array( q|SELECT COUNT(*) FROM class_split_rules|);
-    if( !$split_cnt ) {
-        $dbh->do(q|INSERT INTO `class_split_rules` (`class_split_rule`, `description`, `split_routine`) VALUES
-                               ('dewey', 'Default splitting rules for DDC', 'Dewey'),
-                               ('lcc', 'Default splitting rules for LCC', 'LCC'),
-                               ('generic', 'Generic call number splitting rules', 'Generic')
-            |);
-    }
-
-    my( $source_cnt ) = $dbh->selectrow_array( q|SELECT COUNT(*) FROM class_sources|);
-    if( !$source_cnt ) {
-        $dbh->do(q|INSERT INTO `class_sources` (`cn_source`, `description`, `used`, `class_sort_rule`, `class_split_rule`) VALUES
-                            ('ddc', 'Dewey Decimal Classification', 1, 'dewey', 'dewey'),
-                            ('lcc', 'Library of Congress Classification', 1, 'lcc', 'lcc'),
-                            ('udc', 'Universal Decimal Classification', 0, 'generic', 'generic'),
-                            ('sudocs', 'SuDoc Classification (U.S. GPO)', 0, 'generic', 'generic'),
-                            ('anscr', 'ANSCR (Sound Recordings)', 0, 'generic', 'generic'),
-                            ('z', 'Other/Generic Classification Scheme', 0, 'generic', 'generic')
-            |);
-
-    }
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 22024 - Add missing splitting rule definitions)\n";
-}
index 34e9ad9..4515702 100755 (executable)
@@ -17161,6 +17161,44 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 21065 - Set ON DELETE SET NULL on accountlines.borrowernumber)\n";
 }
 
+$DBversion = '18.11.00.003';
+if( CheckVersion( $DBversion ) ) {
+    # On a new installation the class_sources.sql will have failed, so we need to add all missing data
+    my( $sort_cnt ) = $dbh->selectrow_array( q|SELECT COUNT(*) FROM class_sort_rules|);
+    if( !$sort_cnt ) {
+        $dbh->do(q|INSERT INTO `class_sort_rules` (`class_sort_rule`, `description`, `sort_routine`) VALUES
+                               ('dewey', 'Default filing rules for DDC', 'Dewey'),
+                               ('lcc', 'Default filing rules for LCC', 'LCC'),
+                               ('generic', 'Generic call number filing rules', 'Generic')
+            |);
+    }
+
+    my ( $split_cnt ) = $dbh->selectrow_array( q|SELECT COUNT(*) FROM class_split_rules|);
+    if( !$split_cnt ) {
+        $dbh->do(q|INSERT INTO `class_split_rules` (`class_split_rule`, `description`, `split_routine`) VALUES
+                               ('dewey', 'Default splitting rules for DDC', 'Dewey'),
+                               ('lcc', 'Default splitting rules for LCC', 'LCC'),
+                               ('generic', 'Generic call number splitting rules', 'Generic')
+            |);
+    }
+
+    my( $source_cnt ) = $dbh->selectrow_array( q|SELECT COUNT(*) FROM class_sources|);
+    if( !$source_cnt ) {
+        $dbh->do(q|INSERT INTO `class_sources` (`cn_source`, `description`, `used`, `class_sort_rule`, `class_split_rule`) VALUES
+                            ('ddc', 'Dewey Decimal Classification', 1, 'dewey', 'dewey'),
+                            ('lcc', 'Library of Congress Classification', 1, 'lcc', 'lcc'),
+                            ('udc', 'Universal Decimal Classification', 0, 'generic', 'generic'),
+                            ('sudocs', 'SuDoc Classification (U.S. GPO)', 0, 'generic', 'generic'),
+                            ('anscr', 'ANSCR (Sound Recordings)', 0, 'generic', 'generic'),
+                            ('z', 'Other/Generic Classification Scheme', 0, 'generic', 'generic')
+            |);
+
+    }
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 22024 - Add missing splitting rule definitions)\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.