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 1576-1581 CREATE TABLE `oai_sets_biblios` ( Link Here
1576
1580
1577
DROP TABLE IF EXISTS `old_issues`;
1581
DROP TABLE IF EXISTS `old_issues`;
1578
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1582
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1583
  `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table
1579
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1584
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1580
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1585
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1581
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
1586
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
Lines 1587-1592 CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r Link Here
1587
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1592
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1588
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1593
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1589
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1594
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1595
  PRIMARY KEY (`issue_id`),
1590
  KEY `old_issuesborridx` (`borrowernumber`),
1596
  KEY `old_issuesborridx` (`borrowernumber`),
1591
  KEY `old_issuesitemidx` (`itemnumber`),
1597
  KEY `old_issuesitemidx` (`itemnumber`),
1592
  KEY `branchcode_idx` (`branchcode`),
1598
  KEY `branchcode_idx` (`branchcode`),
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +21 lines)
Lines 7945-7950 if (CheckVersion($DBversion)) { Link Here
7945
    SetVersion($DBversion);
7945
    SetVersion($DBversion);
7946
}
7946
}
7947
7947
7948
$DBversion = "3.15.00.XXX";
7949
if(CheckVersion($DBversion)) {
7950
    $dbh->do(q{
7951
        ALTER TABLE borrowers ADD privacy_relative_checkouts BOOLEAN NOT NULL DEFAULT '0'
7952
    });
7953
    $dbh->do(q{
7954
        ALTER TABLE deletedborrowers ADD privacy_relative_checkouts BOOLEAN NOT NULL DEFAULT '0'
7955
    });
7956
    $dbh->do(q{
7957
        ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
7958
    });
7959
    $dbh->do(q{
7960
        ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
7961
    });
7962
    $dbh->do(qq{
7963
        UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC
7964
    });
7965
    print "Upgrade to $DBversion done (Bug 9303 - relative's checkouts in the opac)\n";
7966
    SetVersion($DBversion);
7967
}
7968
7948
=head1 FUNCTIONS
7969
=head1 FUNCTIONS
7949
7970
7950
=head2 TableExists($table)
7971
=head2 TableExists($table)
7951
- 

Return to bug 9303