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

(-)a/installer/data/mysql/atomicupdate/bug_24476_opt_out_of_auto_renewal.perl (+18 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    unless( column_exists('borrowers','autorenewal') ){
4
        $dbh->do( "ALTER TABLE borrowers ADD COLUMN autorenewal TINYINT(1) NOT NULL DEFAULT 1" );
5
    }
6
    unless( column_exists('deletedborrowers','autorenewal') ){
7
        $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN autorenewal TINYINT(1) NOT NULL DEFAULT 1" );
8
    }
9
    $dbh->do(q{
10
        UPDATE systempreferences
11
        SET value  = CONCAT(value,'|autorenewal') 
12
        WHERE variable IN
13
        ('PatronSelfModificationBorrowerUnwantedField','PatronSelfRegistrationBorrowerUnwantedField')
14
        AND value NOT LIKE '%autorenewal%'
15
    });
16
    SetVersion( $DBversion );
17
    print "Upgrade to $DBversion done (Bug 24476 - Allow patrons to opt-out of autorenewal)\n";
18
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 590-595 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
590
  `login_attempts` int(4) default 0, -- number of failed login attemps
590
  `login_attempts` int(4) default 0, -- number of failed login attemps
591
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
591
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
592
  `anonymized` TINYINT(1) NOT NULL DEFAULT 0, -- flag for data anonymization
592
  `anonymized` TINYINT(1) NOT NULL DEFAULT 0, -- flag for data anonymization
593
  `autorenewal` TINYINT(1) NOT NULL DEFAULT 1, -- flag for allowing auto-renewal
593
  KEY borrowernumber (borrowernumber),
594
  KEY borrowernumber (borrowernumber),
594
  KEY `cardnumber` (`cardnumber`),
595
  KEY `cardnumber` (`cardnumber`),
595
  KEY `sms_provider_id` (`sms_provider_id`)
596
  KEY `sms_provider_id` (`sms_provider_id`)
Lines 1585-1590 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
1585
  `login_attempts` int(4) default 0, -- number of failed login attemps
1586
  `login_attempts` int(4) default 0, -- number of failed login attemps
1586
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
1587
  `overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
1587
  `anonymized` TINYINT(1) NOT NULL DEFAULT 0, -- flag for data anonymization
1588
  `anonymized` TINYINT(1) NOT NULL DEFAULT 0, -- flag for data anonymization
1589
  `autorenewal` TINYINT(1) NOT NULL DEFAULT 1, -- flag for allowing auto-renewal
1588
  UNIQUE KEY `cardnumber` (`cardnumber`),
1590
  UNIQUE KEY `cardnumber` (`cardnumber`),
1589
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
1591
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
1590
  KEY `categorycode` (`categorycode`),
1592
  KEY `categorycode` (`categorycode`),
1591
- 

Return to bug 24476