From e8d837297cfccf3e67b12067e0d64dd3319da120 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 5 Aug 2021 10:14:49 +0100 Subject: [PATCH] Bug 28813: Update database field name Update the database field name from 'delivery_note' to 'failure_code' to more accurately denote it's use. --- .../data/mysql/atomicupdate/bug_28813.perl | 17 +++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_28813.perl diff --git a/installer/data/mysql/atomicupdate/bug_28813.perl b/installer/data/mysql/atomicupdate/bug_28813.perl new file mode 100644 index 0000000000..972b405ea1 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28813.perl @@ -0,0 +1,17 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + if ( column_exists('message_queue', 'delivery_note') ) { + $dbh->do(q{ + ALTER TABLE message_queue CHANGE COLUMN delivery_note failure_code MEDIUMTEXT; + }); + } + + if( !column_exists( 'message_queue', 'failure_code' ) ) { + $dbh->do(q{ + ALTER TABLE message_queue ADD failure_code mediumtext AFTER content_type + }); + } + + # Always end with this (adjust the bug info) + NewVersion( $DBversion, 28813, "Update delivery_note to failure_code in message_queue"); +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 0ff6005d93..da14acace2 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3619,7 +3619,7 @@ CREATE TABLE `message_queue` ( `from_address` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, `reply_address` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, `content_type` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `delivery_note` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `failure_code` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`message_id`), KEY `borrowernumber` (`borrowernumber`), KEY `message_transport_type` (`message_transport_type`), -- 2.20.1