From d23f551f4790ab14c63cde1129f42f539bdb2d0c Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 13 Dec 2021 13:56:38 +0000 Subject: [PATCH] Bug 23352: Database changes Sponsored-By: Brimbank Library, Australia Signed-off-by: Samu Heiskanen Signed-off-by: Andrew Fuerste-Henry --- ...52-add_ccode_column_to_subscriptions_table.pl | 16 ++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 17 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_23352-add_ccode_column_to_subscriptions_table.pl diff --git a/installer/data/mysql/atomicupdate/bug_23352-add_ccode_column_to_subscriptions_table.pl b/installer/data/mysql/atomicupdate/bug_23352-add_ccode_column_to_subscriptions_table.pl new file mode 100644 index 0000000000..c182576392 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23352-add_ccode_column_to_subscriptions_table.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +{ + bug_number => "23352", + description => "Adding new column 'subscription.ccode'", + up => sub { + my ($args) = @_; + my $dbh = $args->{dbh}; + + if( !column_exists( 'subscription', 'ccode' ) ) { + $dbh->do(q{ + ALTER TABLE subscription ADD COLUMN `ccode` varchar(80) DEFAULT NULL AFTER `mana_id` + }); + } + }, +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 34a6a9665d..e0dd9769b6 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4829,6 +4829,7 @@ CREATE TABLE `subscription` ( `itemtype` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `previousitemtype` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `mana_id` int(11) DEFAULT NULL, + `ccode` varchar(80) DEFAULT NULL COMMENT 'collection code to assign to serial items', PRIMARY KEY (`subscriptionid`), KEY `subscription_ibfk_1` (`periodicity`), KEY `subscription_ibfk_2` (`numberpattern`), -- 2.30.2