From e71c9a71f4711cb1c5a3ca963e95ce9ea7d68a02 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 18 Dec 2014 11:59:13 +0100 Subject: [PATCH] [PASSED QA] Bug 13478: Database revision (new biblio column and pref description) TEST PLAN: [1] Run the database revision. Check if the new column is present. Signed-off-by: Nick Signed-off-by: Marcel de Rooy Amended: Added a new column to biblio instead of the new table. Signed-off-by: Kyle M Hall --- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/updatedatabase.pl | 13 +++++++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 9504876..33d4c31 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -127,6 +127,7 @@ CREATE TABLE `biblio` ( -- table that stores bibliographic information `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched `datecreated` DATE NOT NULL, -- the date this record was added to Koha `abstract` mediumtext, -- summary from the MARC record (520$a in MARC21) + `force_item_holds` tinyint, -- works if pref OPACItemHolds is set to 'Selectively force' PRIMARY KEY (`biblionumber`), KEY `blbnoidx` (`biblionumber`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d277bff..15fbeb8 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9832,6 +9832,19 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.19.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(qq| + ALTER TABLE biblio ADD COLUMN force_item_holds tinyint; + |); + $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.2.5