Bug 7534: Add new column "pickup_location" to branches
authorLari Taskula <lari.taskula@jns.fi>
Tue, 7 Feb 2017 17:02:57 +0000 (19:02 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 6 Sep 2018 17:27:05 +0000 (17:27 +0000)
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 <axelle.clarisse@univ-amu.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
installer/data/mysql/atomicupdate/bug_7534.perl [new file with mode: 0644]
installer/data/mysql/kohastructure.sql

diff --git a/installer/data/mysql/atomicupdate/bug_7534.perl b/installer/data/mysql/atomicupdate/bug_7534.perl
new file mode 100644 (file)
index 0000000..0cf94c8
--- /dev/null
@@ -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";
+}
index 8868ca0..cdc97fe 100644 (file)
@@ -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;