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

(-)a/installer/data/mysql/atomicupdate/bug_40936.pl (+33 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "40936",
5
    description => "Add index for default patron sort order",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Do you stuffs here
11
        unless ( index_exists( 'borrowers', 'idx_borrowers_sort_order' ) ) {
12
            $dbh->do(
13
                q{
14
                CREATE INDEX idx_borrowers_sort_order ON borrowers (
15
                    surname(100),
16
                    preferred_name(80),
17
                    firstname(80),
18
                    middle_name(50),
19
                    othernames(50),
20
                    streetnumber(20),
21
                    address(100),
22
                    address2(75),
23
                    city(75),
24
                    state(40),
25
                    zipcode(20),
26
                    country(40)
27
                );
28
            }
29
            );
30
            say $out "Added new index on borrowers table";
31
        }
32
    },
33
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 1623-1628 CREATE TABLE `borrowers` ( Link Here
1623
  KEY `userid_idx` (`userid`),
1623
  KEY `userid_idx` (`userid`),
1624
  KEY `middle_name_idx` (`middle_name`(768)),
1624
  KEY `middle_name_idx` (`middle_name`(768)),
1625
  KEY `preferred_name_idx` (`preferred_name`(768)),
1625
  KEY `preferred_name_idx` (`preferred_name`(768)),
1626
  KEY `idx_borrowers_sort_order` (`surname`(100),`preferred_name`(80),`firstname`(80),`middle_name`(50),`othernames`(50),`streetnumber`(20),`address`(100),`address2`(75),`city`(75),`state`(40),`zipcode`(20),`country`(40)),
1626
  CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`),
1627
  CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`),
1627
  CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`),
1628
  CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`),
1628
  CONSTRAINT `borrowers_ibfk_3` FOREIGN KEY (`sms_provider_id`) REFERENCES `sms_providers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
1629
  CONSTRAINT `borrowers_ibfk_3` FOREIGN KEY (`sms_provider_id`) REFERENCES `sms_providers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
1629
- 

Return to bug 40936