From 1145d891b75ec6af09b7e07b393ca6735f24cf9d Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Wed, 14 Aug 2024 20:00:42 +0000 Subject: [PATCH] Bug 35145: Database updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anneli Österman --- .../bug_35145_order_patron_attributes.pl | 23 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 24 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_35145_order_patron_attributes.pl diff --git a/installer/data/mysql/atomicupdate/bug_35145_order_patron_attributes.pl b/installer/data/mysql/atomicupdate/bug_35145_order_patron_attributes.pl new file mode 100755 index 0000000000..4a7a690ee2 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_35145_order_patron_attributes.pl @@ -0,0 +1,23 @@ +use Modern::Perl; + +return { + bug_number => "35145", + description => "Add display_order column to borrower_attribute_types table", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do( + q{ + ALTER TABLE borrower_attribute_types + ADD COLUMN IF NOT EXISTS display_order INT(11) DEFAULT NULL COMMENT + 'the order in which this attribute type appears in patron form' AFTER `mandatory` + } + ); + + # Print useful stuff here + # tables + say_success( $out, "Added column 'borrower_attribute_types.display_order'" ); + }, +}; \ No newline at end of file diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3bf15c1007..2e934cfbc5 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1261,6 +1261,7 @@ CREATE TABLE `borrower_attribute_types` ( `class` varchar(255) NOT NULL DEFAULT '' COMMENT 'defines a class for an attribute_type', `keep_for_pseudonymization` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is copied to anonymized_borrower_attributes (1 for yes, 0 for no)', `mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not', + `display_order` int(11) DEFAULT NULL COMMENT 'the order in which this attribute type appears in patron form', PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`), KEY `category_code` (`category_code`), -- 2.43.0