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_guarantor_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 894-899 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
894
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
895
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
895
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
896
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
896
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
897
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
898
  `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
897
  KEY borrowernumber (borrowernumber),
899
  KEY borrowernumber (borrowernumber),
898
  KEY `cardnumber` (`cardnumber`)
900
  KEY `cardnumber` (`cardnumber`)
899
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
901
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Lines 1140-1145 CREATE TABLE `import_items` ( Link Here
1140
1142
1141
DROP TABLE IF EXISTS `issues`;
1143
DROP TABLE IF EXISTS `issues`;
1142
CREATE TABLE `issues` ( -- information related to check outs or issues
1144
CREATE TABLE `issues` ( -- information related to check outs or issues
1145
  `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table
1143
  `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1146
  `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1144
  `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
1147
  `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
1145
  `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss)
1148
  `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss)
Lines 1153-1158 CREATE TABLE `issues` ( -- information related to check outs or issues Link Here
1153
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1156
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1154
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1157
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1155
  `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag
1158
  `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag
1159
  PRIMARY KEY (`issue_id`),
1156
  KEY `issuesborridx` (`borrowernumber`),
1160
  KEY `issuesborridx` (`borrowernumber`),
1157
  KEY `itemnumber_idx` (`itemnumber`),
1161
  KEY `itemnumber_idx` (`itemnumber`),
1158
  KEY `branchcode_idx` (`branchcode`),
1162
  KEY `branchcode_idx` (`branchcode`),
Lines 1614-1619 CREATE TABLE `oai_sets_biblios` ( Link Here
1614
1618
1615
DROP TABLE IF EXISTS `old_issues`;
1619
DROP TABLE IF EXISTS `old_issues`;
1616
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1620
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1621
  `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table
1617
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1622
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1618
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1623
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1619
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
1624
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
Lines 1627-1632 CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r Link Here
1627
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1632
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1628
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1633
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1629
  `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag
1634
  `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag
1635
  PRIMARY KEY (`issue_id`),
1630
  KEY `old_issuesborridx` (`borrowernumber`),
1636
  KEY `old_issuesborridx` (`borrowernumber`),
1631
  KEY `old_issuesitemidx` (`itemnumber`),
1637
  KEY `old_issuesitemidx` (`itemnumber`),
1632
  KEY `branchcode_idx` (`branchcode`),
1638
  KEY `branchcode_idx` (`branchcode`),
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 26-37 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
26
('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'),
26
('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'),
27
('AllowOfflineCirculation','0','','If on, enables HTML5 offline circulation functionality.','YesNo'),
27
('AllowOfflineCirculation','0','','If on, enables HTML5 offline circulation functionality.','YesNo'),
28
('AllowOnShelfHolds','0','','Allow hold requests to be placed on items that are not on loan','YesNo'),
28
('AllowOnShelfHolds','0','','Allow hold requests to be placed on items that are not on loan','YesNo'),
29
('AllowPatronToSetCheckoutsVisibilityForGuarantor',  '0', NULL, 'If enabled, the patron can set checkouts to be visible to his or her guarantor',  'YesNo'),
29
('AllowPKIAuth','None','None|Common Name|emailAddress','Use the field from a client-side SSL certificate to look a user in the Koha database','Choice'),
30
('AllowPKIAuth','None','None|Common Name|emailAddress','Use the field from a client-side SSL certificate to look a user in the Koha database','Choice'),
30
('AllowPurchaseSuggestionBranchChoice','0','1','Allow user to choose branch when making a purchase suggestion','YesNo'),
31
('AllowPurchaseSuggestionBranchChoice','0','1','Allow user to choose branch when making a purchase suggestion','YesNo'),
31
('AllowRenewalIfOtherItemsAvailable','0',NULL,'If enabled, allow a patron to renew an item with unfilled holds if other available items can fill that hold.','YesNo'),
32
('AllowRenewalIfOtherItemsAvailable','0',NULL,'If enabled, allow a patron to renew an item with unfilled holds if other available items can fill that hold.','YesNo'),
32
('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'),
33
('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'),
33
('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'),
34
('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'),
34
('AllowSelfCheckReturns','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
35
('AllowSelfCheckReturns','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
36
('AllowStaffToSetCheckoutsVisibilityForGuarantor','0',NULL,'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.',  'YesNo'),
35
('AllowTooManyOverride','1','','If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts','YesNo'),
37
('AllowTooManyOverride','1','','If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts','YesNo'),
36
('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z',NULL,'Alphabet than can be expanded into browse links, e.g. on Home > Patrons','free'),
38
('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z',NULL,'Alphabet than can be expanded into browse links, e.g. on Home > Patrons','free'),
37
('AlternateHoldingsField','',NULL,'The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).','free'),
39
('AlternateHoldingsField','',NULL,'The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).','free'),
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +56 lines)
Lines 37-42 use Getopt::Long; Link Here
37
use C4::Context;
37
use C4::Context;
38
use C4::Installer;
38
use C4::Installer;
39
use C4::Dates;
39
use C4::Dates;
40
use Koha::Database;
40
41
41
use MARC::Record;
42
use MARC::Record;
42
use MARC::File::XML ( BinaryEncoding => 'utf8' );
43
use MARC::File::XML ( BinaryEncoding => 'utf8' );
Lines 9694-9699 if ( CheckVersion($DBversion) ) { Link Here
9694
    } else {
9695
    } else {
9695
        print "Upgrade to $DBversion done (Bug 12905: Check budget integrity: OK)\n";
9696
        print "Upgrade to $DBversion done (Bug 12905: Check budget integrity: OK)\n";
9696
    }
9697
    }
9698
    SetVersion ($DBversion);
9699
}
9700
9701
$DBversion = "3.19.00.XXX";
9702
if(CheckVersion($DBversion)) {
9703
    $dbh->do(q{
9704
        ALTER TABLE borrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0' AFTER privacy
9705
    });
9706
9707
    $dbh->do(q{
9708
        ALTER TABLE deletedborrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0' AFTER privacy
9709
    });
9710
9711
    $dbh->do(q{
9712
        ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
9713
    });
9714
9715
    $dbh->do(q{
9716
        ALTER TABLE old_issues CHANGE issue_id issue_id INT( 11 ) NOT NULL
9717
    });
9718
9719
    $dbh->do(q{
9720
        ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
9721
    });
9722
9723
    $dbh->do(qq{
9724
        UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC
9725
    });
9726
9727
    my $schema = Koha::Database->new()->schema();
9728
    my $max_issue_id = $schema->resultset('Issue')->get_column('issue_id')->max();
9729
    $max_issue_id ||= $schema->resultset('OldIssue')->get_column('issue_id')->max();
9730
    $max_issue_id ||= 0;
9731
    $max_issue_id++;
9732
    $dbh->do(qq{
9733
        ALTER TABLE issues AUTO_INCREMENT = $max_issue_id
9734
    });
9735
9736
    $dbh->do(q{
9737
        INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type )
9738
        VALUES (
9739
            'AllowStaffToSetCheckoutsVisibilityForGuarantor',  '0', NULL,
9740
            'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.',  'YesNo'
9741
        )
9742
    });
9743
9744
    $dbh->do(q{
9745
        INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type )
9746
        VALUES (
9747
            'AllowPatronToSetCheckoutsVisibilityForGuarantor',  '0', NULL,
9748
            'If enabled, the patron can set checkouts to be visible to  his or her guarantor',  'YesNo'
9749
        )
9750
    });
9751
9752
    print "Upgrade to $DBversion done (Bug 9303 - relative's checkouts in the opac)\n";
9697
    SetVersion($DBversion);
9753
    SetVersion($DBversion);
9698
}
9754
}
9699
9755
9700
- 

Return to bug 9303