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 867-872 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
867
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
868
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
868
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
869
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
869
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
870
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
871
  `privacy_relative_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
870
  KEY borrowernumber (borrowernumber),
872
  KEY borrowernumber (borrowernumber),
871
  KEY `cardnumber` (`cardnumber`)
873
  KEY `cardnumber` (`cardnumber`)
872
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
874
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Lines 1113-1118 CREATE TABLE `import_items` ( Link Here
1113
1115
1114
DROP TABLE IF EXISTS `issues`;
1116
DROP TABLE IF EXISTS `issues`;
1115
CREATE TABLE `issues` ( -- information related to check outs or issues
1117
CREATE TABLE `issues` ( -- information related to check outs or issues
1118
  `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table
1116
  `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1119
  `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1117
  `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
1120
  `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
1118
  `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss)
1121
  `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss)
Lines 1124-1129 CREATE TABLE `issues` ( -- information related to check outs or issues Link Here
1124
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1127
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1125
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1128
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1126
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1129
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1130
  PRIMARY KEY (`issue_id`),
1127
  KEY `issuesborridx` (`borrowernumber`),
1131
  KEY `issuesborridx` (`borrowernumber`),
1128
  KEY `itemnumber_idx` (`itemnumber`),
1132
  KEY `itemnumber_idx` (`itemnumber`),
1129
  KEY `branchcode_idx` (`branchcode`),
1133
  KEY `branchcode_idx` (`branchcode`),
Lines 1583-1588 CREATE TABLE `oai_sets_biblios` ( Link Here
1583
1587
1584
DROP TABLE IF EXISTS `old_issues`;
1588
DROP TABLE IF EXISTS `old_issues`;
1585
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1589
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1590
  `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table
1586
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1591
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1587
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1592
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1588
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
1593
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
Lines 1594-1599 CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r Link Here
1594
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1599
  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
1595
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1600
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1596
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1601
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1602
  PRIMARY KEY (`issue_id`),
1597
  KEY `old_issuesborridx` (`borrowernumber`),
1603
  KEY `old_issuesborridx` (`borrowernumber`),
1598
  KEY `old_issuesitemidx` (`itemnumber`),
1604
  KEY `old_issuesitemidx` (`itemnumber`),
1599
  KEY `branchcode_idx` (`branchcode`),
1605
  KEY `branchcode_idx` (`branchcode`),
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +21 lines)
Lines 8465-8470 if ( CheckVersion($DBversion) ) { Link Here
8465
    SetVersion($DBversion);
8465
    SetVersion($DBversion);
8466
}
8466
}
8467
8467
8468
$DBversion = "3.15.00.XXX";
8469
if(CheckVersion($DBversion)) {
8470
    $dbh->do(q{
8471
        ALTER TABLE borrowers ADD privacy_relative_checkouts BOOLEAN NOT NULL DEFAULT '0'
8472
    });
8473
    $dbh->do(q{
8474
        ALTER TABLE deletedborrowers ADD privacy_relative_checkouts BOOLEAN NOT NULL DEFAULT '0'
8475
    });
8476
    $dbh->do(q{
8477
        ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
8478
    });
8479
    $dbh->do(q{
8480
        ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
8481
    });
8482
    $dbh->do(qq{
8483
        UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC
8484
    });
8485
    print "Upgrade to $DBversion done (Bug 9303 - relative's checkouts in the opac)\n";
8486
    SetVersion($DBversion);
8487
}
8488
8468
=head1 FUNCTIONS
8489
=head1 FUNCTIONS
8469
8490
8470
=head2 TableExists($table)
8491
=head2 TableExists($table)
8471
- 

Return to bug 9303