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

(-)a/C4/Circulation.pm (-2 / +3 lines)
Lines 3100-3106 sub GetTransfers { Link Here
3100
    my $dbh = C4::Context->dbh;
3100
    my $dbh = C4::Context->dbh;
3101
3101
3102
    my $query = '
3102
    my $query = '
3103
        SELECT datesent,
3103
        SELECT branchtransfer_id,
3104
               datesent,
3104
               frombranch,
3105
               frombranch,
3105
               tobranch
3106
               tobranch
3106
        FROM branchtransfers
3107
        FROM branchtransfers
Lines 3126-3132 sub GetTransfersFromTo { Link Here
3126
    return unless ( $frombranch && $tobranch );
3127
    return unless ( $frombranch && $tobranch );
3127
    my $dbh   = C4::Context->dbh;
3128
    my $dbh   = C4::Context->dbh;
3128
    my $query = "
3129
    my $query = "
3129
        SELECT itemnumber,datesent,frombranch
3130
        SELECT branchtransfer_id,itemnumber,datesent,frombranch
3130
        FROM   branchtransfers
3131
        FROM   branchtransfers
3131
        WHERE  frombranch=?
3132
        WHERE  frombranch=?
3132
          AND  tobranch=?
3133
          AND  tobranch=?
(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 439-450 CREATE TABLE `branchrelations` ( -- this table links libraries/branches to group Link Here
439
439
440
DROP TABLE IF EXISTS `branchtransfers`;
440
DROP TABLE IF EXISTS `branchtransfers`;
441
CREATE TABLE `branchtransfers` ( -- information for items that are in transit between branches
441
CREATE TABLE `branchtransfers` ( -- information for items that are in transit between branches
442
  `branchtransfer_id` int(12) NOT NULL auto_increment, -- primary key
442
  `itemnumber` int(11) NOT NULL default 0, -- the itemnumber that it is in transit (items.itemnumber)
443
  `itemnumber` int(11) NOT NULL default 0, -- the itemnumber that it is in transit (items.itemnumber)
443
  `datesent` datetime default NULL, -- the date the transfer was initialized
444
  `datesent` datetime default NULL, -- the date the transfer was initialized
444
  `frombranch` varchar(10) NOT NULL default '', -- the branch the transfer is coming from
445
  `frombranch` varchar(10) NOT NULL default '', -- the branch the transfer is coming from
445
  `datearrived` datetime default NULL, -- the date the transfer arrived at its destination
446
  `datearrived` datetime default NULL, -- the date the transfer arrived at its destination
446
  `tobranch` varchar(10) NOT NULL default '', -- the branch the transfer was going to
447
  `tobranch` varchar(10) NOT NULL default '', -- the branch the transfer was going to
447
  `comments` mediumtext, -- any comments related to the transfer
448
  `comments` mediumtext, -- any comments related to the transfer
449
  PRIMARY KEY (`branchtransfer_id`),
448
  KEY `frombranch` (`frombranch`),
450
  KEY `frombranch` (`frombranch`),
449
  KEY `tobranch` (`tobranch`),
451
  KEY `tobranch` (`tobranch`),
450
  KEY `itemnumber` (`itemnumber`),
452
  KEY `itemnumber` (`itemnumber`),
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +7 lines)
Lines 9845-9850 if ( CheckVersion($DBversion) ) { Link Here
9845
    SetVersion($DBversion);
9845
    SetVersion($DBversion);
9846
}
9846
}
9847
9847
9848
$DBversion = "3.19.00.XXX";
9849
if ( CheckVersion($DBversion) ) {
9850
    $dbh->do("ALTER TABLE branchtransfers ADD COLUMN branchtransfer_id int(12) NOT NULL auto_increment FIRST, ADD CONSTRAINT PRIMARY KEY (branchtransfer_id);");
9851
    print "Upgrade to $DBversion done (Bug 14187 - branchtransfer needs a primary key (id) for DBIx and common sense.)\n";
9852
    SetVersion ($DBversion);
9853
}
9854
9848
$DBversion = "3.19.00.014";
9855
$DBversion = "3.19.00.014";
9849
if ( CheckVersion($DBversion) ) {
9856
if ( CheckVersion($DBversion) ) {
9850
    $dbh->do(q|
9857
    $dbh->do(q|
9851
- 

Return to bug 14187