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

Return to bug 24860