Bug 35635: DB Updates

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Lucas Gass 2024-06-05 22:10:34 +00:00 committed by Katrin Fischer
parent 7597d8f0d1
commit 3ec2419152
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,32 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
return {
bug_number => "35635",
description => "Add opac_mandatory column to borrower_attribute_type table",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
if ( !column_exists( 'borrower_attribute_types', 'opac_mandatory' ) ) {
$dbh->do(
q{
ALTER TABLE borrower_attribute_types
ADD COLUMN `opac_mandatory` tinyint(1) DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not on the OPAC'
AFTER `mandatory`
}
);
say $out "Added column 'borrower_attribute_types.opac_mandatory'";
$dbh->do(
q{
UPDATE borrower_attribute_types
SET opac_mandatory = 1 WHERE mandatory = 1;
}
);
say $out "Update opac_mandatory to match mandatory column";
}
},
};

View File

@ -6755,4 +6755,4 @@ CREATE TABLE `zebraqueue` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2024-11-25 12:13:27
-- Dump completed on 2024-11-25 12:13:27