Bug 30481: DBRev 21.12.00.031
[koha.git] / installer / data / mysql / db_revs / 210600002.pl
1 use Modern::Perl;
2
3 return {
4     bug_number => "28490",
5     description => "Bring back accidentally deleted relationship columns",
6     up => sub {
7         my ($args) = @_;
8         my $dbh = $args->{dbh};
9
10         if( !column_exists( 'borrower_modifications', 'relationship' ) ) {
11           $dbh->do(q{
12               ALTER TABLE borrower_modifications ADD COLUMN `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL AFTER `borrowernotes`
13           });
14         }
15
16         if( !column_exists( 'borrowers', 'relationship' ) ) {
17           $dbh->do(q{
18               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`
19           });
20         }
21
22         if( !column_exists( 'deletedborrowers', 'relationship' ) ) {
23           $dbh->do(q{
24               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`
25           });
26         }
27     },
28 }