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 1787-1792 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1787
  `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron this hold is for
1787
  `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron this hold is for
1788
  `reservedate` date default NULL, -- the date the hold was placed
1788
  `reservedate` date default NULL, -- the date the hold was placed
1789
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on
1789
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on
1790
  `volume_id` int(11) NULL default NULL, -- foreign key from the volumes table defining if this is a volume level hold
1790
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1791
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1791
  `notificationdate` date default NULL, -- currently unused
1792
  `notificationdate` date default NULL, -- currently unused
1792
  `reminderdate` date default NULL, -- currently unused
1793
  `reminderdate` date default NULL, -- currently unused
Lines 1814-1820 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1814
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1815
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1815
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1816
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1816
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1817
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1817
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
1818
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE,
1819
  CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
1818
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1820
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1819
1821
1820
--
1822
--
Lines 1827-1832 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1827
  `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron this hold is for
1829
  `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron this hold is for
1828
  `reservedate` date default NULL, -- the date the hold was places
1830
  `reservedate` date default NULL, -- the date the hold was places
1829
  `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on
1831
  `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on
1832
  `volume_id` int(11) NULL default NULL, -- foreign key from the volumes table defining if this is a volume level hold
1830
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1833
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1831
  `notificationdate` date default NULL, -- currently unused
1834
  `notificationdate` date default NULL, -- currently unused
1832
  `reminderdate` date default NULL, -- currently unused
1835
  `reminderdate` date default NULL, -- currently unused
Lines 1856-1861 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1856
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1859
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1857
    ON DELETE SET NULL ON UPDATE SET NULL,
1860
    ON DELETE SET NULL ON UPDATE SET NULL,
1858
  CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
1861
  CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
1862
    ON DELETE SET NULL ON UPDATE SET NULL,
1863
  CONSTRAINT `old_reserves_ibfk_5` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`)
1859
    ON DELETE SET NULL ON UPDATE SET NULL
1864
    ON DELETE SET NULL ON UPDATE SET NULL
1860
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1865
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1861
1866
1862
- 

Return to bug 24860