Bug 34517: (QA follow-up) Perltidy and fix column check

Without the fix a second run of the database update would fail.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Katrin Fischer 2023-11-05 01:14:52 +00:00 committed by Tomas Cohen Arazi
parent dc59d34688
commit 337b18546c
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 9 additions and 5 deletions

View File

@ -8,17 +8,21 @@ return {
my ( $dbh, $out ) = @$args{qw(dbh out)};
# Do you stuffs here
unless ( column_exists( 'borrower_attribute_type', 'searched_by_default' ) ) {
$dbh->do(q{
unless ( column_exists( 'borrower_attribute_types', '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{
$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";
}
},