Bugzilla – Attachment 60969 Details for
Bug 18242
Move of checkouts to old_issues is not handled correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18242: [SOLUTION 1]DB changes - remove PK on old_issues.issue_id
Bug-18242-SOLUTION-1DB-changes---remove-PK-on-oldi.patch (text/plain), 2.71 KB, created by
Jonathan Druart
on 2017-03-09 20:03:26 UTC
(
hide
)
Description:
Bug 18242: [SOLUTION 1]DB changes - remove PK on old_issues.issue_id
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-03-09 20:03:26 UTC
Size:
2.71 KB
patch
obsolete
>From de11726bd5258189e6a84c2921610e135f23174e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 9 Mar 2017 15:53:20 -0300 >Subject: [PATCH] Bug 18242: [SOLUTION 1]DB changes - remove PK on > old_issues.issue_id > >--- > installer/data/mysql/atomicupdate/bug_18185.perl | 10 ++++++++++ > installer/data/mysql/kohastructure.sql | 5 +++-- > 2 files changed, 13 insertions(+), 2 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_18185.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_18185.perl b/installer/data/mysql/atomicupdate/bug_18185.perl >new file mode 100644 >index 0000000..3b444da >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_18185.perl >@@ -0,0 +1,10 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ unless ( column_exists( 'old_issues', 'id' ) ) { >+ $dbh->do(q|ALTER TABLE old_issues DROP PRIMARY KEY|); >+ $dbh->do(q|ALTER TABLE old_issues ADD COLUMN id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST|); >+ } >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 18185 - Add new column old_issues.id as primary key)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 91e6119..99023e9 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1763,7 +1763,8 @@ CREATE TABLE `issues` ( -- information related to check outs or issues > > DROP TABLE IF EXISTS `old_issues`; > CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned >- `issue_id` int(11) NOT NULL, -- primary key for issues table >+ `id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for old_issues table >+ `issue_id` int(11) NOT NULL, -- primary key from the issues table > `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to > `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out > `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd) >@@ -1776,7 +1777,7 @@ CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched > `issuedate` datetime default NULL, -- date the item was checked out or issued > `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag >- PRIMARY KEY (`issue_id`), >+ PRIMARY KEY (`id`), > KEY `old_issuesborridx` (`borrowernumber`), > KEY `old_issuesitemidx` (`itemnumber`), > KEY `branchcode_idx` (`branchcode`), >-- >2.9.3
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 18242
:
60969
|
60970
|
60971
|
60972
|
60973
|
61056
|
61057
|
61254
|
61255
|
61794
|
63168
|
63169
|
63170