From 58b5c6e04acdc3bd35630920ad661190eeca65ab Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 14 Jun 2021 14:37:03 +0000 Subject: [PATCH] Bug 28490: DBRev 21.05.01.001 Signed-off-by: Kyle M Hall --- Koha.pm | 6 +---- ...g_28490-recreate_relationship_columns.perl | 22 ------------------ installer/data/mysql/updatedatabase.pl | 23 +++++++++++++++++++ 3 files changed, 24 insertions(+), 27 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_28490-recreate_relationship_columns.perl diff --git a/Koha.pm b/Koha.pm index 079bb023be..522f5122b4 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,11 +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. -<<<<<<< HEAD -$VERSION = "21.05.00.000"; -======= -$VERSION = "21.06.00.001"; ->>>>>>> 0e8a2d58af (Bug 28489: DBRev 21.06.00.001) +$VERSION = "21.05.01.001"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_28490-recreate_relationship_columns.perl b/installer/data/mysql/atomicupdate/bug_28490-recreate_relationship_columns.perl deleted file mode 100644 index 043a35798c..0000000000 --- a/installer/data/mysql/atomicupdate/bug_28490-recreate_relationship_columns.perl +++ /dev/null @@ -1,22 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - if( !column_exists( 'borrower_modifications', 'relationship' ) ) { - $dbh->do(q{ - ALTER TABLE borrower_modifications ADD COLUMN `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL AFTER `borrowernotes` - }); - } - - if( !column_exists( 'borrowers', 'relationship' ) ) { - $dbh->do(q{ - ALTER TABLE borrowers ADD COLUMN `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'used for children to include the relationship to their guarantor' AFTER `borrowernotes` - }); - } - - if( !column_exists( 'deletedborrowers', 'relationship' ) ) { - $dbh->do(q{ - ALTER TABLE deletedborrowers ADD COLUMN `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'used for children to include the relationship to their guarantor' AFTER `borrowernotes` - }); - } - - NewVersion( $DBversion, 28490, "Bring back accidentally deleted relationship columns"); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index aa013fb101..949cb0d34f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -24291,6 +24291,29 @@ if ( CheckVersion($DBversion) ) { NewVersion( $DBversion, '28489', 'Modify sessions.a_session from longtext to longblob' ); } +$DBversion = '21.05.01.001'; +if( CheckVersion( $DBversion ) ) { + if( !column_exists( 'borrower_modifications', 'relationship' ) ) { + $dbh->do(q{ + ALTER TABLE borrower_modifications ADD COLUMN `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL AFTER `borrowernotes` + }); + } + + if( !column_exists( 'borrowers', 'relationship' ) ) { + $dbh->do(q{ + ALTER TABLE borrowers ADD COLUMN `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'used for children to include the relationship to their guarantor' AFTER `borrowernotes` + }); + } + + if( !column_exists( 'deletedborrowers', 'relationship' ) ) { + $dbh->do(q{ + ALTER TABLE deletedborrowers ADD COLUMN `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'used for children to include the relationship to their guarantor' AFTER `borrowernotes` + }); + } + + NewVersion( $DBversion, 28490, "Bring back accidentally deleted relationship columns"); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5