Bugzilla – Attachment 39060 Details for
Bug 14187
branchtransfer needs a primary key (id) for DBIx and common sense.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14187 - branchtransfer needs a primary key (id) for DBIx and common sense.
Bug-14187---branchtransfer-needs-a-primary-key-id-.patch (text/plain), 3.14 KB, created by
Olli-Antti Kivilahti
on 2015-05-12 08:21:04 UTC
(
hide
)
Description:
Bug 14187 - branchtransfer needs a primary key (id) for DBIx and common sense.
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2015-05-12 08:21:04 UTC
Size:
3.14 KB
patch
obsolete
>From 0bb4b243e303e8f64bc8c29d9b6911796ab779ea Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Tue, 12 May 2015 10:19:05 +0300 >Subject: [PATCH] Bug 14187 - branchtransfer needs a primary key (id) for DBIx > and common sense. > >--- > C4/Circulation.pm | 5 +++-- > installer/data/mysql/kohastructure.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 7 +++++++ > 3 files changed, 12 insertions(+), 2 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 41b6dea..c6ecd62 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3102,7 +3102,8 @@ sub GetTransfers { > my $query = ' > SELECT datesent, > frombranch, >- tobranch >+ tobranch, >+ branchtransfer_id > FROM branchtransfers > WHERE itemnumber = ? > AND datearrived IS NULL >@@ -3126,7 +3127,7 @@ sub GetTransfersFromTo { > return unless ( $frombranch && $tobranch ); > my $dbh = C4::Context->dbh; > my $query = " >- SELECT itemnumber,datesent,frombranch >+ SELECT branchtransfer_id,itemnumber,datesent,frombranch > FROM branchtransfers > WHERE frombranch=? > AND tobranch=? >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index a74d81a..a1f5594 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -439,12 +439,14 @@ CREATE TABLE `branchrelations` ( -- this table links libraries/branches to group > > DROP TABLE IF EXISTS `branchtransfers`; > CREATE TABLE `branchtransfers` ( -- information for items that are in transit between branches >+ `branchtransfer_id` int(12) NOT NULL auto_increment, -- primary key > `itemnumber` int(11) NOT NULL default 0, -- the itemnumber that it is in transit (items.itemnumber) > `datesent` datetime default NULL, -- the date the transfer was initialized > `frombranch` varchar(10) NOT NULL default '', -- the branch the transfer is coming from > `datearrived` datetime default NULL, -- the date the transfer arrived at its destination > `tobranch` varchar(10) NOT NULL default '', -- the branch the transfer was going to > `comments` mediumtext, -- any comments related to the transfer >+ PRIMARY KEY (`branchtransfer_id`), > KEY `frombranch` (`frombranch`), > KEY `tobranch` (`tobranch`), > KEY `itemnumber` (`itemnumber`), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index bc765f1..4b3918e 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9845,6 +9845,13 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.19.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do("ALTER TABLE branchtransfers ADD COLUMN branchtransfer_id int(12) NOT NULL auto_increment FIRST, ADD CONSTRAINT PRIMARY KEY (branchtransfer_id);"); >+ print "Upgrade to $DBversion done (Bug 14187 - branchtransfer needs a primary key (id) for DBIx and common sense.)\n"; >+ SetVersion ($DBversion); >+} >+ > $DBversion = "3.19.00.014"; > if ( CheckVersion($DBversion) ) { > $dbh->do(q| >-- >1.7.9.5
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 14187
:
39058
|
39059
|
39060
|
40075
|
58121
|
58123
|
58124
|
58646
|
58730
|
58880
|
58881
|
58882