Bug 34517: DB updates

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2023-08-11 13:07:52 +00:00 committed by Tomas Cohen Arazi
parent 0c9cabbff7
commit 4c712ef80f
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,25 @@
use Modern::Perl;
return {
bug_number => "34517",
description => "Add option to specify which patron attributes are searched by default",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
# Do you stuffs here
unless ( column_exists( 'borrower_attribute_type', 'searched_by_default' ) ) {
$dbh->do(q{
ALTER TABLE borrower_attribute_types
ADD COLUMN `searched_by_default` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is included in "Standard" patron searches in the staff interface (1 for yes, 0 for no)'
AFTER `staff_searchable`
});
say $out "Added column 'borrower_attribute_types.searched_by_default'";
$dbh->do(q{
UPDATE borrower_attribute_types
SET searched_by_default = 1 WHERE staff_searchable = 1;
});
say $out "Updated values to match staff_searchable columns";
}
},
};

View file

@ -1234,6 +1234,7 @@ CREATE TABLE `borrower_attribute_types` (
`opac_display` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is visible to patrons on their account in the OPAC (1 for yes, 0 for no)',
`opac_editable` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is editable by patrons on their account in the OPAC (1 for yes, 0 for no)',
`staff_searchable` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is searchable via the patron search in the staff interface (1 for yes, 0 for no)',
`searched_by_default` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is included in "Standard" patron searches in the staff interface (1 for yes, 0 for no)',
`authorised_value_category` varchar(32) DEFAULT NULL COMMENT 'foreign key from authorised_values that links this custom field to an authorized value category',
`display_checkout` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field displays in checkout screens',
`category_code` varchar(10) DEFAULT NULL COMMENT 'defines a category for an attribute_type',