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

(-)a/installer/data/mysql/atomicupdate/bug_24412_Attach_waiting_reserve_to_desk.perl (+16 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
    $dbh->do(q{
5
ALTER TABLE reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode,
6
  ADD KEY desk_id (`desk_id`),
7
  ADD CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`desk_id`) REFERENCES `desks` (`desk_id`) ON DELETE CASCADE ON UPDATE CASCADE ;
8
             });
9
    $dbh->do(q{
10
ALTER TABLE old_reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode,
11
  ADD KEY `old_desk_id` (`desk_id`);
12
             });
13
14
    SetVersion( $DBversion );
15
    print "Upgrade to $DBversion done (Bug XXXXX - Attach waiting reserve to desk)\n";
16
}
(-)a/installer/data/mysql/kohastructure.sql (-2 / +5 lines)
Lines 1771-1776 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1771
  `reservedate` date default NULL, -- the date the hold was placed
1771
  `reservedate` date default NULL, -- the date the hold was placed
1772
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on
1772
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on
1773
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1773
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1774
  `desk_id` int(11) default NULL, -- foreign key from the desks table defining which desk the patron should pick this hold up at
1774
  `notificationdate` date default NULL, -- currently unused
1775
  `notificationdate` date default NULL, -- currently unused
1775
  `reminderdate` date default NULL, -- currently unused
1776
  `reminderdate` date default NULL, -- currently unused
1776
  `cancellationdate` date default NULL, -- the date this hold was cancelled
1777
  `cancellationdate` date default NULL, -- the date this hold was cancelled
Lines 1792-1803 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1792
  KEY `biblionumber` (`biblionumber`),
1793
  KEY `biblionumber` (`biblionumber`),
1793
  KEY `itemnumber` (`itemnumber`),
1794
  KEY `itemnumber` (`itemnumber`),
1794
  KEY `branchcode` (`branchcode`),
1795
  KEY `branchcode` (`branchcode`),
1796
  KEY `desk_id` (`desk_id`),
1795
  KEY `itemtype` (`itemtype`),
1797
  KEY `itemtype` (`itemtype`),
1796
  CONSTRAINT `reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1798
  CONSTRAINT `reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1797
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1799
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1798
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1800
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1799
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1801
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1800
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
1802
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE,
1803
  CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`desk_id`) REFERENCES `desks` (`desk_id`) ON DELETE CASCADE ON UPDATE CASCADE
1801
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1804
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1802
1805
1803
--
1806
--
Lines 1811-1816 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1811
  `reservedate` date default NULL, -- the date the hold was places
1814
  `reservedate` date default NULL, -- the date the hold was places
1812
  `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on
1815
  `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on
1813
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1816
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1817
  `desk_id` int(11) default NULL, -- foreign key from the desks table defining which desk the patron should pick this hold up at
1814
  `notificationdate` date default NULL, -- currently unused
1818
  `notificationdate` date default NULL, -- currently unused
1815
  `reminderdate` date default NULL, -- currently unused
1819
  `reminderdate` date default NULL, -- currently unused
1816
  `cancellationdate` date default NULL, -- the date this hold was cancelled
1820
  `cancellationdate` date default NULL, -- the date this hold was cancelled
1817
- 

Return to bug 24412