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

(-)a/installer/data/mysql/atomicupdate/volumes.perl (+16 lines)
Lines 39-44 if ( CheckVersion( $DBversion ) ) { Link Here
39
        });
39
        });
40
    }
40
    }
41
41
42
    unless ( column_exists( 'reserves', 'volume_id' ) ) {
43
        $dbh->do(q{
44
            ALTER TABLE reserves
45
            ADD COLUMN `volume_id` int(11) NULL default NULL AFTER biblionumber,
46
            ADD CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;
47
        });
48
    }
49
50
    unless ( column_exists( 'old_reserves', 'volume_id' ) ) {
51
        $dbh->do(q{
52
            ALTER TABLE old_reserves
53
            ADD COLUMN `volume_id` int(11) NULL default NULL AFTER biblionumber,
54
            ADD CONSTRAINT `old_reserves_ibfk_5` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE SET NULL ON UPDATE SET NULL;
55
        });
56
    }
57
42
    # Always end with this (adjust the bug info)
58
    # Always end with this (adjust the bug info)
43
    SetVersion( $DBversion );
59
    SetVersion( $DBversion );
44
    print "Upgrade to $DBversion done (Bug XXXXX - Add ability to define volumes for items on a record)\n";
60
    print "Upgrade to $DBversion done (Bug XXXXX - Add ability to define volumes for items on a record)\n";
(-)a/installer/data/mysql/kohastructure.sql (-2 / +6 lines)
Lines 1779-1784 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1779
  `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron this hold is for
1779
  `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron this hold is for
1780
  `reservedate` date default NULL, -- the date the hold was placed
1780
  `reservedate` date default NULL, -- the date the hold was placed
1781
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on
1781
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on
1782
  `volume_id` int(11) NULL default NULL, -- foreign key from the volumes table defining if this is a volume level hold
1782
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1783
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1783
  `notificationdate` date default NULL, -- currently unused
1784
  `notificationdate` date default NULL, -- currently unused
1784
  `reminderdate` date default NULL, -- currently unused
1785
  `reminderdate` date default NULL, -- currently unused
Lines 1806-1812 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1806
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1807
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1807
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1808
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1808
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1809
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1809
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
1810
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE,
1811
  CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
1810
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1812
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1811
1813
1812
--
1814
--
Lines 1819-1824 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1819
  `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron this hold is for
1821
  `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron this hold is for
1820
  `reservedate` date default NULL, -- the date the hold was places
1822
  `reservedate` date default NULL, -- the date the hold was places
1821
  `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on
1823
  `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on
1824
  `volume_id` int(11) NULL default NULL, -- foreign key from the volumes table defining if this is a volume level hold
1822
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1825
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1823
  `notificationdate` date default NULL, -- currently unused
1826
  `notificationdate` date default NULL, -- currently unused
1824
  `reminderdate` date default NULL, -- currently unused
1827
  `reminderdate` date default NULL, -- currently unused
Lines 1848-1853 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1848
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1851
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1849
    ON DELETE SET NULL ON UPDATE SET NULL,
1852
    ON DELETE SET NULL ON UPDATE SET NULL,
1850
  CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
1853
  CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
1854
    ON DELETE SET NULL ON UPDATE SET NULL,
1855
  CONSTRAINT `old_reserves_ibfk_5` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`)
1851
    ON DELETE SET NULL ON UPDATE SET NULL
1856
    ON DELETE SET NULL ON UPDATE SET NULL
1852
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1857
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1853
1858
1854
- 

Return to bug 24860