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

(-)a/installer/data/mysql/atomicupdate/bug_24860.perl (+21 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if ( CheckVersion( $DBversion ) ) {
3
    unless ( column_exists( 'reserves', 'item_group_id' ) ) {
4
        $dbh->do(q{
5
            ALTER TABLE reserves
6
            ADD COLUMN `item_group_id` int(11) NULL default NULL AFTER biblionumber,
7
            ADD CONSTRAINT `reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE CASCADE;
8
        });
9
    }
10
11
    unless ( column_exists( 'old_reserves', 'item_group_id' ) ) {
12
        $dbh->do(q{
13
            ALTER TABLE old_reserves
14
            ADD COLUMN `item_group_id` int(11) NULL default NULL AFTER biblionumber,
15
            ADD CONSTRAINT `old_reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE SET NULL;
16
        });
17
    }
18
19
    SetVersion( $DBversion );
20
    print "Upgrade to $DBversion done (Bug 24860 - Add ability to place item group level holds)\n";
21
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +4 lines)
Lines 3967-3972 CREATE TABLE `old_reserves` ( Link Here
3967
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
3967
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
3968
  `reservedate` date DEFAULT NULL COMMENT 'the date the hold was places',
3968
  `reservedate` date DEFAULT NULL COMMENT 'the date the hold was places',
3969
  `biblionumber` int(11) DEFAULT NULL COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
3969
  `biblionumber` int(11) DEFAULT NULL COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
3970
  `item_group_id` int(11) NULL default NULL COMMENT 'foreign key from the item_groups table defining if this is an item group level hold',
3970
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
3971
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
3971
  `desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at',
3972
  `desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at',
3972
  `notificationdate` date DEFAULT NULL COMMENT 'currently unused',
3973
  `notificationdate` date DEFAULT NULL COMMENT 'currently unused',
Lines 3993-3998 CREATE TABLE `old_reserves` ( Link Here
3993
  KEY `old_reserves_itemnumber` (`itemnumber`),
3994
  KEY `old_reserves_itemnumber` (`itemnumber`),
3994
  KEY `old_reserves_branchcode` (`branchcode`),
3995
  KEY `old_reserves_branchcode` (`branchcode`),
3995
  KEY `old_reserves_itemtype` (`itemtype`),
3996
  KEY `old_reserves_itemtype` (`itemtype`),
3997
  CONSTRAINT `old_reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE SET NULL,
3996
  CONSTRAINT `old_reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL,
3998
  CONSTRAINT `old_reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL,
3997
  CONSTRAINT `old_reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE SET NULL,
3999
  CONSTRAINT `old_reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE SET NULL,
3998
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL,
4000
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL,
Lines 4413-4418 CREATE TABLE `reserves` ( Link Here
4413
  `borrowernumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
4415
  `borrowernumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
4414
  `reservedate` date DEFAULT NULL COMMENT 'the date the hold was placed',
4416
  `reservedate` date DEFAULT NULL COMMENT 'the date the hold was placed',
4415
  `biblionumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
4417
  `biblionumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
4418
  `item_group_id` int(11) NULL default NULL COMMENT 'foreign key from the item_groups table defining if this is an item group level hold',
4416
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
4419
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
4417
  `desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at',
4420
  `desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at',
4418
  `notificationdate` date DEFAULT NULL COMMENT 'currently unused',
4421
  `notificationdate` date DEFAULT NULL COMMENT 'currently unused',
Lines 4441-4446 CREATE TABLE `reserves` ( Link Here
4441
  KEY `branchcode` (`branchcode`),
4444
  KEY `branchcode` (`branchcode`),
4442
  KEY `desk_id` (`desk_id`),
4445
  KEY `desk_id` (`desk_id`),
4443
  KEY `itemtype` (`itemtype`),
4446
  KEY `itemtype` (`itemtype`),
4447
  CONSTRAINT `reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
4444
  CONSTRAINT `reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4448
  CONSTRAINT `reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4445
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4449
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4446
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4450
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4447
- 

Return to bug 24860