From d9bd25552b4fdfc937cd4b6631666f18a3596fb4 Mon Sep 17 00:00:00 2001 From: Eric Garcia Date: Tue, 6 Aug 2024 16:09:09 +0000 Subject: [PATCH] Bug 33641: DB Update Added return_branch to issues table and old_issues table --- Koha/Schema/Result/Issue.pm | 14 ++++++++++++-- Koha/Schema/Result/OldIssue.pm | 14 ++++++++++++-- installer/data/mysql/atomicupdate/bug_33641.pl | 8 ++++---- 3 files changed, 28 insertions(+), 8 deletions(-) mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug_33641.pl diff --git a/Koha/Schema/Result/Issue.pm b/Koha/Schema/Result/Issue.pm index 05fde17f46..89c9f692d9 100644 --- a/Koha/Schema/Result/Issue.pm +++ b/Koha/Schema/Result/Issue.pm @@ -79,6 +79,14 @@ foreign key, linking to the branches table for the location the item was checked date the item was returned, will be NULL until moved to old_issues +=head2 return_branch + + data_type: 'varchar' + is_nullable: 1 + size: 10 + +foreign key, linking to the branches table for the location the item was checked out + =head2 lastreneweddate data_type: 'datetime' @@ -191,6 +199,8 @@ __PACKAGE__->add_columns( datetime_undef_if_invalid => 1, is_nullable => 1, }, + "return_branch", + { data_type => "varchar", is_nullable => 1, size => 10 }, "lastreneweddate", { data_type => "datetime", @@ -311,8 +321,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-09-12 11:34:50 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eNzDAKc3bmTLWeDu8u4nTQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2024-08-06 16:06:37 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hSiUDS3csy2TMnMIhHrl0g __PACKAGE__->add_columns( '+auto_renew' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/OldIssue.pm b/Koha/Schema/Result/OldIssue.pm index 50ef4a82e0..ae4e8c3e7f 100644 --- a/Koha/Schema/Result/OldIssue.pm +++ b/Koha/Schema/Result/OldIssue.pm @@ -78,6 +78,14 @@ foreign key, linking to the branches table for the location the item was checked date the item was returned +=head2 return_branch + + data_type: 'varchar' + is_nullable: 1 + size: 10 + +foreign key, linking to the branches table for the location the item was checked out + =head2 lastreneweddate data_type: 'datetime' @@ -190,6 +198,8 @@ __PACKAGE__->add_columns( datetime_undef_if_invalid => 1, is_nullable => 1, }, + "return_branch", + { data_type => "varchar", is_nullable => 1, size => 10 }, "lastreneweddate", { data_type => "datetime", @@ -306,8 +316,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-03-18 12:35:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0XlDHyg8uB3oD9/jJtOxRg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2024-08-06 16:06:37 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gUCScHz5jPId/nP/IJJHVg __PACKAGE__->add_columns( '+auto_renew' => { is_boolean => 1 }, diff --git a/installer/data/mysql/atomicupdate/bug_33641.pl b/installer/data/mysql/atomicupdate/bug_33641.pl old mode 100644 new mode 100755 index d5f8361746..d065078b6c --- a/installer/data/mysql/atomicupdate/bug_33641.pl +++ b/installer/data/mysql/atomicupdate/bug_33641.pl @@ -5,13 +5,13 @@ return { bug_number => "33641", description => "Added issues.return_branch and old_issues.return_branch", up => sub { - my ($args) = @_; + my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; - if( !column_exists( 'issues', 'return_branch' ) ) { + if( !column_exists( 'issues', 'return_branch' ) ) { $dbh->do(q{ ALTER TABLE issues - ADD COLUMN return_branch varchar(10) DEFAULT NULL + ADD COLUMN return_branch varchar(10) DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out' AFTER returndate }); @@ -28,5 +28,5 @@ return { say_success( $out, "Added column 'old_issues.return_branch'"); } - }, + }, }; -- 2.30.2