Bugzilla – Attachment 39058 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), 2.28 KB, created by
Olli-Antti Kivilahti
on 2015-05-12 07:21:05 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 07:21:05 UTC
Size:
2.28 KB
patch
obsolete
>From 4056568a901dd342f54d0bfccf5c0f897fd7e526 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. > >--- > installer/data/mysql/kohastructure.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 7 +++++++ > 2 files changed, 9 insertions(+) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index f22aceb..3a934c8 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 3bb3086..2334474 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9875,6 +9875,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 13743 - Primary key for issues-table)\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