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

(-)a/installer/data/mysql/kohastructure.sql (+6 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
  `privacy_relative_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
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 865-870 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
865
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
866
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
866
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
867
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
867
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
868
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
869
  `privacy_relative_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
868
  KEY borrowernumber (borrowernumber),
870
  KEY borrowernumber (borrowernumber),
869
  KEY `cardnumber` (`cardnumber`)
871
  KEY `cardnumber` (`cardnumber`)
870
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
872
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Lines 1111-1116 CREATE TABLE `import_items` ( Link Here
1111
1113
1112
DROP TABLE IF EXISTS `issues`;
1114
DROP TABLE IF EXISTS `issues`;
1113
CREATE TABLE `issues` ( -- information related to check outs or issues
1115
CREATE TABLE `issues` ( -- information related to check outs or issues
1116
  `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table
1114
  `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1117
  `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1115
  `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
1118
  `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
1116
  `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss)
1119
  `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss)
Lines 1122-1127 CREATE TABLE `issues` ( -- information related to check outs or issues Link Here
1122
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1125
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1123
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1126
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1124
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1127
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1128
  PRIMARY KEY (`issue_id`),
1125
  KEY `issuesborridx` (`borrowernumber`),
1129
  KEY `issuesborridx` (`borrowernumber`),
1126
  KEY `itemnumber_idx` (`itemnumber`),
1130
  KEY `itemnumber_idx` (`itemnumber`),
1127
  KEY `branchcode_idx` (`branchcode`),
1131
  KEY `branchcode_idx` (`branchcode`),
Lines 1577-1582 CREATE TABLE `oai_sets_biblios` ( Link Here
1577
1581
1578
DROP TABLE IF EXISTS `old_issues`;
1582
DROP TABLE IF EXISTS `old_issues`;
1579
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1583
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1584
  `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table
1580
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1585
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1581
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1586
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1582
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
1587
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
Lines 1588-1593 CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r Link Here
1588
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1593
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1589
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1594
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1590
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1595
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1596
  PRIMARY KEY (`issue_id`),
1591
  KEY `old_issuesborridx` (`borrowernumber`),
1597
  KEY `old_issuesborridx` (`borrowernumber`),
1592
  KEY `old_issuesitemidx` (`itemnumber`),
1598
  KEY `old_issuesitemidx` (`itemnumber`),
1593
  KEY `branchcode_idx` (`branchcode`),
1599
  KEY `branchcode_idx` (`branchcode`),
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +21 lines)
Lines 8202-8207 if ( CheckVersion($DBversion) ) { Link Here
8202
    SetVersion($DBversion);
8202
    SetVersion($DBversion);
8203
}
8203
}
8204
8204
8205
$DBversion = "3.15.00.XXX";
8206
if(CheckVersion($DBversion)) {
8207
    $dbh->do(q{
8208
        ALTER TABLE borrowers ADD privacy_relative_checkouts BOOLEAN NOT NULL DEFAULT '0'
8209
    });
8210
    $dbh->do(q{
8211
        ALTER TABLE deletedborrowers ADD privacy_relative_checkouts BOOLEAN NOT NULL DEFAULT '0'
8212
    });
8213
    $dbh->do(q{
8214
        ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
8215
    });
8216
    $dbh->do(q{
8217
        ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
8218
    });
8219
    $dbh->do(qq{
8220
        UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC
8221
    });
8222
    print "Upgrade to $DBversion done (Bug 9303 - relative's checkouts in the opac)\n";
8223
    SetVersion($DBversion);
8224
}
8225
8205
=head1 FUNCTIONS
8226
=head1 FUNCTIONS
8206
8227
8207
=head2 TableExists($table)
8228
=head2 TableExists($table)
8208
- 

Return to bug 9303