From 2a5a98368618b0b5f2d850c32f4afb57c924809d Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 7 Jun 2024 16:14:33 +0000 Subject: [PATCH] Bug 37054: DBUpdate Signed-off-by: David Nind --- .../atomicupdate/bug_37054_add_branchcolor.pl | 23 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 24 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl diff --git a/installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl b/installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl new file mode 100755 index 00000000000..8bb54539bc5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl @@ -0,0 +1,23 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "37054", + description => "Add branches.branchcolor", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + if ( !column_exists( 'branches', 'branchcolor' ) ) { + $dbh->do( + q{ + ALTER TABLE branches + ADD COLUMN `branchcolor` varchar(16) DEFAULT 0 COMMENT 'defines the branch color' + AFTER `opacusercss` + } + ); + } + say $out "Added column 'branch.branchcolor'"; + + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index f3dd950328d..cca981a98e5 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1666,6 +1666,7 @@ CREATE TABLE `branches` ( `public` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'whether this library should show in the opac', `opacuserjs` longtext DEFAULT NULL COMMENT 'branch specific javascript for the OPAC', `opacusercss` longtext DEFAULT NULL COMMENT 'branch specific css for the OPAC', + `branchcolor` varchar(16) DEFAULT NULL COMMENT 'branch specific color', PRIMARY KEY (`branchcode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- 2.39.2