Bugzilla – Attachment 58493 Details for
Bug 17813
Table borrower_attributes needs a primary key
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17813: Add a primary key to borrower_attributes
Bug-17813-Add-a-primary-key-to-borrowerattributes.patch (text/plain), 2.50 KB, created by
Kyle M Hall (khall)
on 2016-12-29 14:44:51 UTC
(
hide
)
Description:
Bug 17813: Add a primary key to borrower_attributes
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-12-29 14:44:51 UTC
Size:
2.50 KB
patch
obsolete
>From a240c405a9b16cc14e9ce0ba32d4ade9b9a8b422 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 23 Dec 2016 15:54:02 -0300 >Subject: [PATCH] Bug 17813: Add a primary key to borrower_attributes > >This patch adds 'borrower_attributes' a field (if) which >will act as a primary key. > >This is needed for DBIC to be used to handle rows, and also will help >when faced with the implementation of the REST api for this resource. > >To test: >- Run all patron modification / attributes and verify nothing breaks >- Sign off :-D > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../mysql/atomicupdate/bug_17813_borrower_attributes_pk.sql | 11 +++++++++++ > installer/data/mysql/kohastructure.sql | 1 + > 2 files changed, 12 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_17813_borrower_attributes_pk.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_17813_borrower_attributes_pk.sql b/installer/data/mysql/atomicupdate/bug_17813_borrower_attributes_pk.sql >new file mode 100644 >index 0000000..04da55d >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_17813_borrower_attributes_pk.sql >@@ -0,0 +1,11 @@ >+ALTER TABLE `borrower_attributes` ADD `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; >+ >+-- $DBversion = "16.12.00.XXX"; >+-- if(CheckVersion($DBversion)) { >+-- $dbh->do(q{ >+-- ALTER TABLE `borrower_attributes` ADD `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST >+-- }); >+-- >+-- print "Upgrade to $DBversion done (Bug 17813: Table borrower_attributes needs a primary key\n"; >+-- SetVersion ($DBversion); >+-- } >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index f40692e..9e9302b 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1676,6 +1676,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons > > DROP TABLE IF EXISTS `borrower_attributes`; > CREATE TABLE `borrower_attributes` ( -- values of custom patron fields known as extended patron attributes linked to patrons/borrowers >+ `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, -- Row id field > `borrowernumber` int(11) NOT NULL, -- foreign key from the borrowers table, defines which patron/borrower has this attribute > `code` varchar(10) NOT NULL, -- foreign key from the borrower_attribute_types table, defines which custom field this value was entered for > `attribute` varchar(255) default NULL, -- custom patron field value >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17813
:
58422
|
58423
|
58493
|
58494
|
58879
|
59070
|
59071
|
59072