[Koha-patches] [PATCH 2/2] Rotating Collection > DB upgrade to 102

Kyle M Hall kyle.m.hall at gmail.com
Tue Jan 19 23:22:03 CET 2010


From: Frédéric Demians <f.demians at tamil.fr>

---
 installer/data/mysql/updatedatabase.pl |   26 ++++++++++++++++++++++++++
 kohaversion.pl                         |    2 +-
 2 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 1e9f947..d3b2053 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -3305,6 +3305,32 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
+$DBversion = "3.01.00.102";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("
+      CREATE TABLE `collections` (
+        `colId` int(11) NOT NULL auto_increment,
+        `colTitle` varchar(100) NOT NULL default '',
+        `colDesc` text NOT NULL,
+        `colBranchcode` varchar(4) default NULL COMMENT 'branchcode for branch where item should be held.',
+        PRIMARY KEY  (`colId`)
+      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+    ");
+       
+    $dbh->do("
+      CREATE TABLE `collections_tracking` (
+        `ctId` int(11) NOT NULL auto_increment,
+        `colId` int(11) NOT NULL default '0' COMMENT 'collections.colId',
+        `itemnumber` int(11) NOT NULL default '0' COMMENT 'items.itemnumber',
+        PRIMARY KEY  (`ctId`)
+      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+    ");
+    $dbh->do("
+        INSERT INTO permissions (module_bit, code, description) 
+        VALUES ( 13, 'rotating_collections', 'Manage Rotating collections')" );
+	print "Upgrade to $DBversion done (added collection and collection_tracking tables for rotataing collection functionnality)\n";
+    SetVersion ($DBversion);
+}
 
 =item DropAllForeignKeys($table)
 
diff --git a/kohaversion.pl b/kohaversion.pl
index 10e6238..bee2a05 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.01.00.101';
+    our $VERSION = '3.01.00.102';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
-- 
1.6.4.3




More information about the Koha-patches mailing list