From 7fbb3e0500227c7e28d4346438aad594ca7dd9d0 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Wed, 9 Feb 2022 23:06:37 +0000 Subject: [PATCH] Bug 24239: Add column illrequests.date_due --- Koha/Schema/Result/Illrequest.pm | 14 ++++++++++++++ .../bug_24239-add_date_due_to_illrequests.pl | 15 +++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 3 files changed, 30 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_24239-add_date_due_to_illrequests.pl diff --git a/Koha/Schema/Result/Illrequest.pm b/Koha/Schema/Result/Illrequest.pm index 16e7d9e6ed..ecc75eb797 100644 --- a/Koha/Schema/Result/Illrequest.pm +++ b/Koha/Schema/Result/Illrequest.pm @@ -47,6 +47,14 @@ Patron associated with request Potential bib linked to request +=head2 date_due + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +Custom date due specified by backend, leave NULL for default date_due calculation + =head2 branchcode data_type: 'varchar' @@ -180,6 +188,12 @@ __PACKAGE__->add_columns( { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "biblio_id", { data_type => "integer", is_nullable => 1 }, + "date_due", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, "branchcode", { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 50 }, "status", diff --git a/installer/data/mysql/atomicupdate/bug_24239-add_date_due_to_illrequests.pl b/installer/data/mysql/atomicupdate/bug_24239-add_date_due_to_illrequests.pl new file mode 100755 index 0000000000..a8eb9beda1 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24239-add_date_due_to_illrequests.pl @@ -0,0 +1,15 @@ +use Modern::Perl; + +return { + bug_number => "24239", + description => "Add date_due to illrequests", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + # Do you stuffs here + $dbh->do(q{ + ALTER TABLE `illrequests` + ADD `date_due` datetime DEFAULT NULL AFTER `biblio_id` + }); + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 4411ae7604..d7bfed630e 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2775,6 +2775,7 @@ CREATE TABLE `illrequests` ( `illrequest_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ILL request number', `borrowernumber` int(11) DEFAULT NULL COMMENT 'Patron associated with request', `biblio_id` int(11) DEFAULT NULL COMMENT 'Potential bib linked to request', + `date_due` datetime DEFAULT NULL COMMENT 'Custom date due specified by backend, leave NULL for default date_due calculation', `branchcode` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The branch associated with the request', `status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Current Koha status of request', `status_alias` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Foreign key to relevant authorised_values.authorised_value', -- 2.25.1