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

(-)a/installer/data/mysql/atomicupdate/bug_17813_borrower_attributes_pk.sql (+11 lines)
Line 0 Link Here
1
ALTER TABLE `borrower_attributes` ADD `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
2
3
-- $DBversion = "16.12.00.XXX";
4
-- if(CheckVersion($DBversion)) {
5
--     $dbh->do(q{
6
--         ALTER TABLE `borrower_attributes` ADD `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
7
--     });
8
--
9
--     print "Upgrade to $DBversion done (Bug 17813: Table borrower_attributes needs a primary key\n";
10
--     SetVersion ($DBversion);
11
-- }
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 1676-1681 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
1676
1676
1677
DROP TABLE IF EXISTS `borrower_attributes`;
1677
DROP TABLE IF EXISTS `borrower_attributes`;
1678
CREATE TABLE `borrower_attributes` ( -- values of custom patron fields known as extended patron attributes linked to patrons/borrowers
1678
CREATE TABLE `borrower_attributes` ( -- values of custom patron fields known as extended patron attributes linked to patrons/borrowers
1679
  `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, -- Row id field
1679
  `borrowernumber` int(11) NOT NULL, -- foreign key from the borrowers table, defines which patron/borrower has this attribute
1680
  `borrowernumber` int(11) NOT NULL, -- foreign key from the borrowers table, defines which patron/borrower has this attribute
1680
  `code` varchar(10) NOT NULL, -- foreign key from the borrower_attribute_types table, defines which custom field this value was entered for
1681
  `code` varchar(10) NOT NULL, -- foreign key from the borrower_attribute_types table, defines which custom field this value was entered for
1681
  `attribute` varchar(255) default NULL, -- custom patron field value
1682
  `attribute` varchar(255) default NULL, -- custom patron field value
1682
- 

Return to bug 17813