From 5bbc0090f3f1f486a5ac08efe25f601d4daa3ebf Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 25 Oct 2023 11:37:41 -0300 Subject: [PATCH] Bug 33970: DBRev 23.06.00.053 Signed-off-by: Tomas Cohen Arazi --- Koha.pm | 2 +- .../bug_33970.pl => db_revs/230600053.pl} | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) rename installer/data/mysql/{atomicupdate/bug_33970.pl => db_revs/230600053.pl} (68%) diff --git a/Koha.pm b/Koha.pm index 2ca1512cb7..f093752f65 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "23.06.00.052"; +$VERSION = "23.06.00.053"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_33970.pl b/installer/data/mysql/db_revs/230600053.pl similarity index 68% rename from installer/data/mysql/atomicupdate/bug_33970.pl rename to installer/data/mysql/db_revs/230600053.pl index b6b8d93d4b..9a96d1f707 100755 --- a/installer/data/mysql/atomicupdate/bug_33970.pl +++ b/installer/data/mysql/db_revs/230600053.pl @@ -2,28 +2,27 @@ use Modern::Perl; return { bug_number => "33970", - description => "Add 'backend' column and to composite primary key in illrequestattributes", + description => "Bind ILL attributes to specific backends", up => sub { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; if ( !column_exists( 'illrequestattributes', 'backend' ) ) { - say $out "Adding 'backend' column to 'illrequestattributes' table"; $dbh->do( q{ ALTER TABLE illrequestattributes ADD COLUMN backend varchar(80) NOT NULL COMMENT 'API ILL backend name' AFTER illrequest_id } ); + say $out "Added column 'illrequestattributes.backend'"; - say $out "Dropping illrequestattributes_ifk foreign key in 'illrequestattributes' table "; $dbh->do(q{ ALTER TABLE illrequestattributes DROP FOREIGN KEY illrequestattributes_ifk }); + say $out "Removed 'illrequestattributes.illrequestattributes_ifk' foreign key"; - say $out "Dropping primary key in 'illrequestattributes' table "; $dbh->do(q{ ALTER TABLE illrequestattributes DROP PRIMARY KEY }); + say $out "Removed 'illrequestattributes' primary key"; - say $out "Creating new primary key in 'illrequestattributes' table "; $dbh->do(q{ ALTER TABLE illrequestattributes ADD PRIMARY KEY( illrequest_id, backend, type (191)) }); + say $out "Added new primary key in 'illrequestattributes'"; - say $out "Creating new foreign key constraint in 'illrequestattributes' table "; $dbh->do( q{ ALTER TABLE illrequestattributes ADD CONSTRAINT illrequestattributes_ifk @@ -32,8 +31,8 @@ return { ON DELETE CASCADE ON UPDATE CASCADE; } ); + say $out "Added 'illrequestattributes.illrequestattributes_ifk' foreign key"; - say $out "Updating backend value for all pre-existing illrequestattributes"; $dbh->do( q{ UPDATE @@ -43,6 +42,7 @@ return { WHERE ira . illrequest_id = ir.illrequest_id; } ); + say $out "Updated 'backend' column for all pre-existing rows in 'illrequestattributes'"; } }, }; -- 2.39.5