Bug 14053: DBRev 3.21.00.007
authorTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 8 Jun 2015 13:48:23 +0000 (10:48 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 8 Jun 2015 13:49:29 +0000 (10:49 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Koha.pm
installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbasket.sql [deleted file]
installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbooksellers.sql [deleted file]
installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbudgets.sql [deleted file]
installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbudgets_planning.sql [deleted file]
installer/data/mysql/atomicupdate/bug_14053-add_keys_aqorders.sql [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 55730eb..695e28e 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 = "3.21.00.006";
+$VERSION = "3.21.00.007";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbasket.sql b/installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbasket.sql
deleted file mode 100644 (file)
index 82c65e3..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER IGNORE TABLE `aqbasket`
-    ADD KEY `authorisedby` (`authorisedby`)
-;
\ No newline at end of file
diff --git a/installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbooksellers.sql b/installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbooksellers.sql
deleted file mode 100644 (file)
index f70175d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER IGNORE TABLE `aqbooksellers`
-    ADD KEY `name` (`name`(255))
-;
diff --git a/installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbudgets.sql b/installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbudgets.sql
deleted file mode 100644 (file)
index 03c9150..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-ALTER IGNORE TABLE `aqbudgets`
-    ADD KEY `budget_parent_id` (`budget_parent_id`),
-    ADD KEY `budget_code` (`budget_code`),
-    ADD KEY `budget_branchcode` (`budget_branchcode`),
-    ADD KEY `budget_period_id` (`budget_period_id`),
-    ADD KEY `budget_owner_id` (`budget_owner_id`)
-;
\ No newline at end of file
diff --git a/installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbudgets_planning.sql b/installer/data/mysql/atomicupdate/bug_14053-add_keys_aqbudgets_planning.sql
deleted file mode 100644 (file)
index 3c1b2b6..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER IGNORE TABLE `aqbudgets_planning`
-    ADD KEY `budget_period_id` (`budget_period_id`)
-;
\ No newline at end of file
diff --git a/installer/data/mysql/atomicupdate/bug_14053-add_keys_aqorders.sql b/installer/data/mysql/atomicupdate/bug_14053-add_keys_aqorders.sql
deleted file mode 100644 (file)
index ff8a585..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-ALTER IGNORE TABLE `aqorders`
-    ADD KEY `parent_ordernumber` (`parent_ordernumber`),
-    ADD KEY `orderstatus` (`orderstatus`)
-;
\ No newline at end of file
index 34c2d74..a5587c6 100755 (executable)
@@ -10554,6 +10554,37 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.21.00.007";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(q|
+        ALTER IGNORE TABLE aqbasket
+            ADD KEY authorisedby (authorisedby)
+    |);
+    $dbh->do(q|
+        ALTER IGNORE TABLE aqbooksellers
+            ADD KEY name (name(255))
+    |);
+    $dbh->do(q|
+        ALTER IGNORE TABLE aqbudgets
+            ADD KEY budget_parent_id (budget_parent_id),
+            ADD KEY budget_code (budget_code),
+            ADD KEY budget_branchcode (budget_branchcode),
+            ADD KEY budget_period_id (budget_period_id),
+            ADD KEY budget_owner_id (budget_owner_id)
+    |);
+    $dbh->do(q|
+        ALTER IGNORE TABLE aqbudgets_planning
+            ADD KEY budget_period_id (budget_period_id)
+    |);
+    $dbh->do(q|
+        ALTER IGNORE TABLE aqorders
+            ADD KEY parent_ordernumber (parent_ordernumber),
+            ADD KEY orderstatus (orderstatus)
+    |);
+    print "Upgrade to $DBversion done (Bug 14053: Acquisition db tables are missing indexes)\n";
+    SetVersion ($DBversion);
+}
+
 # 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.