From eff4790e6d85e659263c8873ebb8da74b7c59060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Wed, 2 Jun 2021 20:37:25 +0300 Subject: [PATCH] Bug 28490: Bring back accidentally deleted relationship columns These were in active use before and were accidentally deleted in Bug 26995. This restores those deleted relationship columns. To test: 1) verify the borrower_modifications, borrowers, deletedborrowers contain the column exactly like it was before after applying these patches by comparing to the old kohastructure.sql version Signed-off-by: Kyle M Hall --- ...g_28490-recreate_relationship_columns.perl | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_28490-recreate_relationship_columns.perl diff --git a/installer/data/mysql/atomicupdate/bug_28490-recreate_relationship_columns.perl b/installer/data/mysql/atomicupdate/bug_28490-recreate_relationship_columns.perl new file mode 100644 index 0000000000..1940ca0a7c --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28490-recreate_relationship_columns.perl @@ -0,0 +1,22 @@ +$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 + }); + } + + 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' + }); + } + + 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' + }); + } + + NewVersion( $DBversion, 28490, "Bring back accidentally deleted relationship columns"); +} -- 2.30.1 (Apple Git-130)