From 8424362a788438ffd9160ce800f8553b8e98b21a Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 28 Apr 2023 14:31:34 +0000 Subject: [PATCH] Bug 30928: DB and Schema updates --- Koha/Schema/Result/Statistic.pm | 10 ++++++++++ installer/data/mysql/atomicupdate/bug_30928.pl | 18 ++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 3 files changed, 29 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_30928.pl diff --git a/Koha/Schema/Result/Statistic.pm b/Koha/Schema/Result/Statistic.pm index e6096eae2b..6477af1aab 100644 --- a/Koha/Schema/Result/Statistic.pm +++ b/Koha/Schema/Result/Statistic.pm @@ -108,6 +108,14 @@ foreign key from the items table, links transaction to a specific collection cod foreign key from the borrowers table, links transaction to a specific borrower category +=head2 interface + + data_type: 'varchar' + is_nullable: 1 + size: 30 + +interface acted upon + =cut __PACKAGE__->add_columns( @@ -137,6 +145,8 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 80 }, "categorycode", { data_type => "varchar", is_nullable => 1, size => 10 }, + "interface", + { data_type => "varchar", is_nullable => 1, size => 30 }, ); diff --git a/installer/data/mysql/atomicupdate/bug_30928.pl b/installer/data/mysql/atomicupdate/bug_30928.pl new file mode 100755 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 50796112dc..454a00d775 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -5360,6 +5360,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.30.2