From af716ed56c0ae74db241509d8ccfb5803c0ef889 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 1 May 2008 12:17:06 -0500 Subject: [PATCH] kohabug 2076 - add browser if necessary (DB rev 078) Ensure that the browser table is added during an upgrade from 2.2.9. Signed-off-by: Joshua Ferraro --- installer/data/mysql/updatedatabase.pl | 20 ++++++++++++++++++++ kohaversion.pl | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 7544a2aaac..33bfa8d976 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -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 diff --git a/kohaversion.pl b/kohaversion.pl index bf05d00ed5..df4bb194b0 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -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 -- 2.39.5