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 (-6 / +9 lines)
Lines 8-24 return { Link Here
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
9
10
        # Do you stuffs here
10
        # Do you stuffs here
11
        unless ( column_exists( 'borrower_attribute_type', 'searched_by_default' ) ) {
11
        unless ( column_exists( 'borrower_attribute_types', 'searched_by_default' ) ) {
12
            $dbh->do(q{
12
            $dbh->do(
13
                q{
13
                ALTER TABLE borrower_attribute_types
14
                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
                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
                AFTER `staff_searchable`
16
            });
17
            }
18
            );
17
            say $out "Added column 'borrower_attribute_types.searched_by_default'";
19
            say $out "Added column 'borrower_attribute_types.searched_by_default'";
18
            $dbh->do(q{
20
            $dbh->do(
21
                q{
19
                UPDATE borrower_attribute_types
22
                UPDATE borrower_attribute_types
20
                SET searched_by_default = 1 WHERE staff_searchable = 1;
23
                SET searched_by_default = 1 WHERE staff_searchable = 1;
21
            });
24
            }
25
            );
22
            say $out "Updated values to match staff_searchable columns";
26
            say $out "Updated values to match staff_searchable columns";
23
        }
27
        }
24
    },
28
    },
25
- 

Return to bug 34517