kohabug 2076 - add browser if necessary (DB rev 078)
authorGalen Charlton <galen.charlton@liblime.com>
Thu, 1 May 2008 17:17:06 +0000 (12:17 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 1 May 2008 23:59:30 +0000 (18:59 -0500)
Ensure that the browser table is added during an upgrade
from 2.2.9.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index 7544a2a..33bfa8d 100755 (executable)
@@ -1455,6 +1455,26 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
        SetVersion ($DBversion);
 }
 
+$DBversion = "3.00.00.078";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    my ($print_error) = $dbh->{PrintError};
+    $dbh->{PrintError} = 0;
+    
+    unless ($dbh->do("SELECT 1 FROM browser")) {
+        $dbh->{PrintError} = $print_error;
+        $dbh->do("CREATE TABLE `browser` (
+                    `level` int(11) NOT NULL,
+                    `classification` varchar(20) NOT NULL,
+                    `description` varchar(255) NOT NULL,
+                    `number` bigint(20) NOT NULL,
+                    `endnode` tinyint(4) NOT NULL
+                  ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
+    }
+    $dbh->{PrintError} = $print_error;
+       print "Upgrade to $DBversion done (add browser table if not already present)\n";
+       SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
index bf05d00..df4bb19 100644 (file)
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = "3.00.00.077";
+    our $VERSION = "3.00.00.078";
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install