From c3624c41a9b56a2790977b731a70cf48c789f5da Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 18 Dec 2014 11:59:13 +0100 Subject: [PATCH] Bug 13478: Database revision for table biblio_force_item_holds TEST PLAN: [1] Run the database revision. Check if the new table is present. Signed-off-by: Nick --- installer/data/mysql/kohastructure.sql | 10 ++++++++++ installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 0d2700b..93d1c1c 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -132,6 +132,16 @@ CREATE TABLE `biblio` ( -- table that stores bibliographic information ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- +-- Table structure for table `biblio_force_item_holds` +-- + +DROP TABLE IF EXISTS `biblio_force_item_holds`; +CREATE TABLE `biblio_force_item_holds` ( -- biblios with forced item holds + `biblionumber` int NOT NULL, -- primary key + PRIMARY KEY (`biblionumber`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- -- Table structure for table `biblio_framework` -- diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 7e00df3..f01f795 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9732,6 +9732,20 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.19.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(qq| + CREATE TABLE biblio_force_item_holds + (biblionumber int NOT NULL PRIMARY KEY); + |); + $dbh->do(qq| + UPDATE systempreferences SET explanation = 'Allow OPAC users to place hold on specific items. If No, users can only request next available copy. If Yes, users can choose between next available and specific copy. If Force, users *must* choose a specific copy. Selectiveforce works on specific biblios.' + WHERE variable = 'OPACItemHolds'; + |); + print "Upgrade to $DBversion done (Bug 13478 - Update OPACItemHolds description)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 1.7.10.4