From 5a01b6dddcab0e86032a17e0ecb392ed25d6db2b Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 14 Sep 2023 12:23:49 +0000 Subject: [PATCH] Bug 34789: Database and API update Currently the erm_eholdings_titles table has a field called preceeding_publication_title_id. This should be preceding_publication_title_id Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit cf94eae1ff89d1c99604dd68429c77f7247aa9a7) Signed-off-by: Fridolin Somers --- .../definitions/erm_eholdings_title.yaml | 4 +-- .../swagger/paths/erm_eholdings_titles.yaml | 4 +-- .../atomicupdate/bug_34789-rename-column.pl | 35 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 6 ++-- 4 files changed, 42 insertions(+), 7 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_34789-rename-column.pl diff --git a/api/v1/swagger/definitions/erm_eholdings_title.yaml b/api/v1/swagger/definitions/erm_eholdings_title.yaml index 7387a185f1..7185009fef 100644 --- a/api/v1/swagger/definitions/erm_eholdings_title.yaml +++ b/api/v1/swagger/definitions/erm_eholdings_title.yaml @@ -124,8 +124,8 @@ properties: type: - string - "null" - preceeding_publication_title_id: - description: preceeding_publication_title_id of the title + preceding_publication_title_id: + description: preceding_publication_title_id of the title type: - string - "null" diff --git a/api/v1/swagger/paths/erm_eholdings_titles.yaml b/api/v1/swagger/paths/erm_eholdings_titles.yaml index 652aa16b87..1a713a8a61 100644 --- a/api/v1/swagger/paths/erm_eholdings_titles.yaml +++ b/api/v1/swagger/paths/erm_eholdings_titles.yaml @@ -134,9 +134,9 @@ name: parent_publication_title_id required: false type: string - - description: Case insensitive search on title preceeding_publication_title_id + - description: Case insensitive search on title preceding_publication_title_id in: query - name: preceeding_publication_title_id + name: preceding_publication_title_id required: false type: string - description: Case insensitive search on title access_type diff --git a/installer/data/mysql/atomicupdate/bug_34789-rename-column.pl b/installer/data/mysql/atomicupdate/bug_34789-rename-column.pl new file mode 100755 index 0000000000..f305f27ffa --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_34789-rename-column.pl @@ -0,0 +1,35 @@ +use Modern::Perl; + +return { + bug_number => "34789", + description => "A single line description", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + if ( column_exists( 'erm_eholdings_titles', 'preceeding_publication_title_id' ) ) { + $dbh->do( + q{ + ALTER TABLE erm_eholdings_titles RENAME COLUMN preceeding_publication_title_id TO preceding_publication_title_id + } + ); + say $out 'Column renamed to preceding_publication_title_id'; + } + if ( column_exists( 'erm_eholdings_titles', 'publication_title' ) ) { + $dbh->do( + q{ + ALTER TABLE erm_eholdings_titles MODIFY COLUMN publication_title mediumtext + } + ); + say $out 'Column datatype amended to mediumtext'; + } + if ( column_exists( 'erm_eholdings_titles', 'notes' ) ) { + $dbh->do( + q{ + ALTER TABLE erm_eholdings_titles MODIFY COLUMN notes mediumtext + } + ); + say $out 'Column datatype amended to mediumtext'; + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 0664afe72a..cb3ecfa8ad 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2991,7 +2991,7 @@ DROP TABLE IF EXISTS `erm_eholdings_titles`; CREATE TABLE `erm_eholdings_titles` ( `title_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key', `biblio_id` int(11) DEFAULT NULL, - `publication_title` varchar(255) DEFAULT NULL, + `publication_title` mediumtext DEFAULT NULL, `external_id` varchar(255) DEFAULT NULL, `print_identifier` varchar(255) DEFAULT NULL, `online_identifier` varchar(255) DEFAULT NULL, @@ -3005,7 +3005,7 @@ CREATE TABLE `erm_eholdings_titles` ( `first_author` varchar(255) DEFAULT NULL, `embargo_info` varchar(255) DEFAULT NULL, `coverage_depth` varchar(255) DEFAULT NULL, - `notes` varchar(255) DEFAULT NULL, + `notes` mediumtext DEFAULT NULL, `publisher_name` varchar(255) DEFAULT NULL, `publication_type` varchar(80) DEFAULT NULL, `date_monograph_published_print` varchar(255) DEFAULT NULL, @@ -3014,7 +3014,7 @@ CREATE TABLE `erm_eholdings_titles` ( `monograph_edition` varchar(255) DEFAULT NULL, `first_editor` varchar(255) DEFAULT NULL, `parent_publication_title_id` varchar(255) DEFAULT NULL, - `preceeding_publication_title_id` varchar(255) DEFAULT NULL, + `preceding_publication_title_id` varchar(255) DEFAULT NULL, `access_type` varchar(255) DEFAULT NULL, PRIMARY KEY (`title_id`), KEY `erm_eholdings_titles_ibfk_2` (`biblio_id`), -- 2.39.5