From c196a3437f1a7c5e9d016d0984206ecd4829ecfd 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 Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Fridolin Somers --- ...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 488f1439c8..852d448804 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4878,6 +4878,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.39.5