From 079811de4a60ca52707d44bb1be2bf12991e94ad Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Tue, 7 Feb 2017 19:02:57 +0200 Subject: [PATCH] Bug 7534: Add new column "pickup_location" to branches This patch adds a new column "pickup_location" for each library. This value defines whether a library can be used as a pickup location or not. For extended configurability, this flag could perhaps be considered as a part of issuing rules, but as of now, this patch only offers a simple flag into each library. This method also allows easy way for REST API to determine valid pickup locations by querying the /libraries endpoint. To test: 1. perl installer/data/mysql/updatedatabase.pl 2. Observe DEV atomic update: bug_7534.perl Upgrade to XXX done (Bug 7534 - Let libraries have configuration for pickup locations) https://bugs.koha-community.org/show_bug.cgi?id=7354 Signed-off-by: Koha Team AMU --- installer/data/mysql/atomicupdate/bug_7534.perl | 7 +++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 8 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_7534.perl diff --git a/installer/data/mysql/atomicupdate/bug_7534.perl b/installer/data/mysql/atomicupdate/bug_7534.perl new file mode 100644 index 0000000000..0cf94c800c --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_7534.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "ALTER TABLE branches ADD COLUMN pickup_location TINYINT(1) not null default 1" ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 7534 - Let libraries have configuration for pickup locations)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 92b86350a1..9bd0913efa 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -267,6 +267,7 @@ CREATE TABLE `branches` ( -- information about your libraries or branches are st opac_info MEDIUMTEXT, -- HTML that displays in OPAC `geolocation` VARCHAR(255) default NULL, -- geolocation of your library `marcorgcode` VARCHAR(16) default NULL, -- MARC Organization Code, see http://www.loc.gov/marc/organizations/orgshome.html, when empty defaults to syspref MARCOrgCode + `pickup_location` tinyint(1) NOT NULL default 1, -- the ability to act as a pickup location PRIMARY KEY (`branchcode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- 2.11.0