[Koha-patches] [PATCH] kohabug 2076 - add browser if necessary (DB rev 078)
Galen Charlton
galen.charlton at liblime.com
Thu May 1 19:17:06 CEST 2008
Ensure that the browser table is added during an upgrade
from 2.2.9.
---
installer/data/mysql/updatedatabase.pl | 20 ++++++++++++++++++++
kohaversion.pl | 2 +-
2 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 7544a2a..33bfa8d 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 bf05d00..df4bb19 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
--
1.5.5.rc0.16.g02b00
More information about the Koha-patches
mailing list