View | Details | Raw Unified | Return to bug 34517
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_34517_add_searched_by_default_to_attribute_types.pl (+25 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "34517",
5
    description => "Add option to specify which patron attributes are searched by default",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Do you stuffs here
11
        unless ( column_exists( 'borrower_attribute_type', 'searched_by_default' ) ) {
12
            $dbh->do(q{
13
                ALTER TABLE borrower_attribute_types
14
                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)'
15
                AFTER `staff_searchable`
16
            });
17
            say $out "Added column 'borrower_attribute_types.searched_by_default'";
18
            $dbh->do(q{
19
                UPDATE borrower_attribute_types
20
                SET searched_by_default = 1 WHERE staff_searchable = 1;
21
            });
22
            say $out "Updated values to match staff_searchable columns";
23
        }
24
    },
25
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 1193-1198 CREATE TABLE `borrower_attribute_types` ( Link Here
1193
  `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)',
1193
  `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)',
1194
  `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)',
1194
  `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)',
1195
  `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)',
1195
  `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)',
1196
  `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)',
1196
  `authorised_value_category` varchar(32) DEFAULT NULL COMMENT 'foreign key from authorised_values that links this custom field to an authorized value category',
1197
  `authorised_value_category` varchar(32) DEFAULT NULL COMMENT 'foreign key from authorised_values that links this custom field to an authorized value category',
1197
  `display_checkout` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field displays in checkout screens',
1198
  `display_checkout` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field displays in checkout screens',
1198
  `category_code` varchar(10) DEFAULT NULL COMMENT 'defines a category for an attribute_type',
1199
  `category_code` varchar(10) DEFAULT NULL COMMENT 'defines a category for an attribute_type',
1199
- 

Return to bug 34517