From 06d4a1f982783fa0cf109e4b1e097bebc2191788 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 27 Oct 2021 14:48:16 +0100 Subject: [PATCH] Bug 27360: Add public field to branches table Signed-off-by: Barbara Johnson Signed-off-by: Christopher Brannon Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- installer/data/mysql/atomicupdate/bug_27360.pl | 16 ++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 17 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_27360.pl diff --git a/installer/data/mysql/atomicupdate/bug_27360.pl b/installer/data/mysql/atomicupdate/bug_27360.pl new file mode 100755 index 0000000000..d5ced6d62f --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_27360.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => "27360", + description => "Make display of libraries configurable", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + unless ( column_exists('branches', 'public') ) { + $dbh->do(q{ + ALTER TABLE branches ADD public tinyint DEFAULT 1 AFTER pickup_location + }); + } + }, +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index f6bd1ed2e7..91990eb47a 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1485,6 +1485,7 @@ CREATE TABLE `branches` ( `geolocation` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'geolocation of your library', `marcorgcode` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '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 COMMENT 'the ability to act as a pickup location', + `public` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'whether this library should show in the opac', PRIMARY KEY (`branchcode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- 2.39.5