From 6834a64d61a4eafb2740516a4ddb3f1ff5f7b8b0 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 21 Feb 2024 22:34:49 +0000 Subject: [PATCH] Bug 35067: Add authorised_value_categories.parent column --- ...thorised_value_categories.parent_column.pl | 20 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 21 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_35067_-_add_authorised_value_categories.parent_column.pl diff --git a/installer/data/mysql/atomicupdate/bug_35067_-_add_authorised_value_categories.parent_column.pl b/installer/data/mysql/atomicupdate/bug_35067_-_add_authorised_value_categories.parent_column.pl new file mode 100755 index 00000000000..5bb84fd99e8 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_35067_-_add_authorised_value_categories.parent_column.pl @@ -0,0 +1,20 @@ +use Modern::Perl; + +return { + bug_number => "35067", + description => "Allow authorised value parent category so categories can be linked and shown together", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + if ( !column_exists( 'authorised_value_categories', 'parent' ) ) { + $dbh->do( + q{ + ALTER TABLE authorised_value_categories ADD COLUMN `parent` varchar(32) DEFAULT NULL AFTER `is_system` + } + ); + + say $out "Added column 'authorised_value_categories.parent'"; + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 16310f0f449..396e92cb6c4 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1008,6 +1008,7 @@ DROP TABLE IF EXISTS `authorised_value_categories`; CREATE TABLE `authorised_value_categories` ( `category_name` varchar(32) NOT NULL DEFAULT '', `is_system` tinyint(1) DEFAULT 0, + `parent` varchar(32) DEFAULT NULL, PRIMARY KEY (`category_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- 2.30.2