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

(-)a/installer/data/mysql/kohastructure.sql (-1 / +7 lines)
Lines 479-489 CREATE TABLE collections ( Link Here
479
  colId integer(11) NOT NULL auto_increment,
479
  colId integer(11) NOT NULL auto_increment,
480
  colTitle varchar(100) NOT NULL DEFAULT '',
480
  colTitle varchar(100) NOT NULL DEFAULT '',
481
  colDesc text NOT NULL,
481
  colDesc text NOT NULL,
482
  colBranchcode varchar(4) DEFAULT NULL comment 'branchcode for branch where item should be held.',
482
  colBranchcode varchar(10) DEFAULT NULL comment 'branchcode for branch where item should be held.',
483
  PRIMARY KEY (colId)
483
  PRIMARY KEY (colId)
484
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8;
484
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8;
485
485
486
--
486
--
487
-- Constraints for table `collections`
488
--
489
ALTER TABLE `collections`
490
  ADD CONSTRAINT `collections_ibfk_1` FOREIGN KEY (`colBranchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE;
491
492
--
487
-- Table: collections_tracking
493
-- Table: collections_tracking
488
--
494
--
489
DROP TABLE IF EXISTS collections_tracking;
495
DROP TABLE IF EXISTS collections_tracking;
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +16 lines)
Lines 8465-8470 if ( CheckVersion($DBversion) ) { Link Here
8465
    SetVersion($DBversion);
8465
    SetVersion($DBversion);
8466
}
8466
}
8467
8467
8468
$DBversion = "3.17.00.XXX";
8469
if ( CheckVersion($DBversion) ) {
8470
    $dbh->do(q{
8471
        ALTER TABLE collections CHANGE colBranchcode colBranchcode VARCHAR( 10 ) NULL DEFAULT NULL
8472
    });
8473
    $dbh->do(q{
8474
        ALTER TABLE collections ADD INDEX ( colBranchcode )
8475
    });
8476
    $dbh->do(q{
8477
        ALTER TABLE collections
8478
            ADD CONSTRAINT collections_ibfk_1 FOREIGN KEY (colBranchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE
8479
    });
8480
    print "Upgrade to $DBversion done (Bug 8836 - Resurrect Rotating Collections)\n";
8481
    SetVersion($DBversion);
8482
}
8483
8468
=head1 FUNCTIONS
8484
=head1 FUNCTIONS
8469
8485
8470
=head2 TableExists($table)
8486
=head2 TableExists($table)
8471
- 

Return to bug 8836