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 / +63 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 9688-9693 if ( CheckVersion($DBversion) ) { Link Here
9688
    } else {
9689
    } else {
9689
        print "Upgrade to $DBversion done (Bug 12905: Check budget integrity: OK)\n";
9690
        print "Upgrade to $DBversion done (Bug 12905: Check budget integrity: OK)\n";
9690
    }
9691
    }
9692
    SetVersion ($DBversion);
9693
}
9694
9695
$DBversion = "3.19.00.XXX";
9696
if(CheckVersion($DBversion)) {
9697
    $dbh->do(q{
9698
        ALTER TABLE borrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0'
9699
    });
9700
    $dbh->do(q{
9701
        ALTER TABLE deletedborrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0'
9702
    });
9703
    $dbh->do(q{
9704
        ALTER TABLE old_issues DROP PRIMARY KEY
9705
    });
9706
    $dbh->do(q{
9707
        ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
9708
    });
9709
    $dbh->do(q{
9710
        ALTER TABLE old_issues DROP INDEX itemnumber_idx
9711
    });
9712
    $dbh->do(q{
9713
        ALTER TABLE issues DROP PRIMARY KEY
9714
    });
9715
    $dbh->do(q{
9716
        ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
9717
    });
9718
    $dbh->do(q{
9719
        ALTER TABLE issues DROP INDEX itemnumber_idx
9720
    });
9721
    $dbh->do(q{
9722
        ALTER TABLE issues ADD UNIQUE itemnumber_idx (itemnumber)
9723
    });
9724
    $dbh->do(qq{
9725
        UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC
9726
    });
9727
9728
    my $schema = Koha::Database->new()->schema();
9729
    my $max_issue_id = $schema->resultset('Issue')->get_column('issue_id')->max();
9730
    $max_issue_id ||= $schema->resultset('OldIssue')->get_column('issue_id')->max();
9731
    $max_issue_id ||= 0;
9732
    $max_issue_id++;
9733
    $dbh->do(qq{
9734
        ALTER TABLE issues AUTO_INCREMENT = $max_issue_id
9735
    });
9736
9737
    $dbh->do(q{
9738
        INSERT INTO systempreferences (variable, value, options, explanation, type )
9739
        VALUES (
9740
            'AllowStaffToSetCheckoutsVisibilityForGuarantor',  '0', NULL,
9741
            'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.',  'YesNo'
9742
        )
9743
    });
9744
9745
    $dbh->do(q{
9746
        INSERT INTO systempreferences (variable, value, options, explanation, type )
9747
        VALUES (
9748
            'AllowPatronToSetCheckoutsVisibilityForGuarantor',  '0', NULL,
9749
            'If enabled, the patron can set checkouts to be visible to  his or her guarantor',  'YesNo'
9750
        )
9751
    });
9752
9753
    print "Upgrade to $DBversion done (Bug 9303 - relative's checkouts in the opac)\n";
9691
    SetVersion($DBversion);
9754
    SetVersion($DBversion);
9692
}
9755
}
9693
9756
9694
- 

Return to bug 9303