From 50eab25ecc2ed4df40b0630009a0cc9ae8186e39 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 (new biblio column and pref description) Content-Type: text/plain; charset=utf-8 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. --- 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 08ef9ee..f3ecd72 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 0ed56c6..e0c1bd4 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9793,6 +9793,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.7.6