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

(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 265-270 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
265
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
265
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
266
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
266
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
267
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
267
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
268
  `bortimestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others)
268
  UNIQUE KEY `cardnumber` (`cardnumber`),
269
  UNIQUE KEY `cardnumber` (`cardnumber`),
269
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
270
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
270
  KEY `categorycode` (`categorycode`),
271
  KEY `categorycode` (`categorycode`),
Lines 876-881 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
876
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
877
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
877
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
878
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
878
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
879
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
880
  `bortimestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others)
879
  KEY borrowernumber (borrowernumber),
881
  KEY borrowernumber (borrowernumber),
880
  KEY `cardnumber` (`cardnumber`)
882
  KEY `cardnumber` (`cardnumber`)
881
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
883
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +13 lines)
Lines 9470-9475 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
9470
    SetVersion($DBversion);
9470
    SetVersion($DBversion);
9471
}
9471
}
9472
9472
9473
9474
$DBversion = "3.17.00.XXX";
9475
if ( CheckVersion($DBversion) ) {
9476
    $dbh->do(q|
9477
ALTER TABLE borrowers ADD COLUMN bortimestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER privacy;
9478
    |);
9479
    $dbh->do(q|
9480
ALTER TABLE deletedborrowers ADD COLUMN bortimestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER privacy;
9481
    |);
9482
    print "Upgrade to $DBversion done (Bug 10459: Borrowers should have a timestamp)\n";
9483
    SetVersion($DBversion);
9484
}
9485
9473
=head1 FUNCTIONS
9486
=head1 FUNCTIONS
9474
9487
9475
=head2 TableExists($table)
9488
=head2 TableExists($table)
9476
- 

Return to bug 10459