Bug 28813: Update database field name

Update the database field name from 'delivery_note' to 'failure_code' to
more accurately denote it's use.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2021-08-05 10:14:49 +01:00 committed by Kyle M Hall
parent 533640b077
commit 29e3003d57
2 changed files with 18 additions and 1 deletions

View File

@ -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");
}

View File

@ -3626,7 +3626,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`),