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

(-)a/installer/data/mysql/atomicupdate/bug_22899_add_items_constraint_to_tmpholdsqueue.perl (+13 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
4
    unless ( foreign_key_exists( 'tmp_holdsqueue', 'tmp_holdsqueue_ibfk_1' ) ) {
5
        $dbh->do(q{
6
            ALTER TABLE tmp_holdsqueue
7
            ADD CONSTRAINT `tmp_holdsqueue_ibfk_1` FOREIGN KEY (`itemnumber`)
8
            REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
9
        });
10
    }
11
    SetVersion( $DBversion );
12
    print "Upgrade to $DBversion done (Bug XXXXX - Add items constraint to tmp_holdsqueue)\n";
13
}
(-)a/installer/data/mysql/kohastructure.sql (-2 / +3 lines)
Lines 2458-2464 CREATE TABLE `tmp_holdsqueue` ( Link Here
2458
  `holdingbranch` varchar(10) default NULL,
2458
  `holdingbranch` varchar(10) default NULL,
2459
  `pickbranch` varchar(10) default NULL,
2459
  `pickbranch` varchar(10) default NULL,
2460
  `notes` MEDIUMTEXT,
2460
  `notes` MEDIUMTEXT,
2461
  `item_level_request` tinyint(4) NOT NULL default 0
2461
  `item_level_request` tinyint(4) NOT NULL default 0,
2462
  CONSTRAINT `tmp_holdsqueue_ibfk_1` FOREIGN KEY (`itemnumber`)
2463
    REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
2462
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2464
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2463
2465
2464
--
2466
--
2465
- 

Return to bug 22899