From 2f01be170f7c6c4911810b692e1da70e31c6f335 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Sun, 30 Apr 2023 21:31:44 +0000 Subject: [PATCH] Bug 30928: (QA follow-up) DB updates Signed-off-by: Aleisha Amohia Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/bug_30928.pl | 18 ++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 19 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_30928.pl diff --git a/installer/data/mysql/atomicupdate/bug_30928.pl b/installer/data/mysql/atomicupdate/bug_30928.pl new file mode 100644 index 0000000000..726c9c2452 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30928.pl @@ -0,0 +1,18 @@ +use Modern::Perl; +return { + bug_number => "30928", + description => "Add interface field to statistics table", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + if( !column_exists( 'statistics', 'interface' ) ) { + $dbh->do(q{ + ALTER TABLE statistics + ADD COLUMN interface varchar(30) NULL DEFAULT NULL + COMMENT "interface" + AFTER categorycode + }); + say $out "Added column 'statistics.interface'"; + } + }, +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 702f0bcdac..eec19c087b 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -5384,6 +5384,7 @@ CREATE TABLE `statistics` ( `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table, links transaction to a specific borrower', `ccode` varchar(80) DEFAULT NULL COMMENT 'foreign key from the items table, links transaction to a specific collection code', `categorycode` varchar(10) DEFAULT NULL COMMENT 'foreign key from the borrowers table, links transaction to a specific borrower category', + `interface` varchar(30) DEFAULT NULL COMMENT 'the context this action was taken in', KEY `timeidx` (`datetime`), KEY `branch_idx` (`branch`), KEY `type_idx` (`type`), -- 2.39.5