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

(-)a/installer/data/mysql/atomicupdate/volumes.perl (+16 lines)
Lines 34-39 if ( CheckVersion( $DBversion ) ) { Link Here
34
        });
34
        });
35
    }
35
    }
36
36
37
    unless ( column_exists( 'reserves', 'volume_id' ) ) {
38
        $dbh->do(q{
39
            ALTER TABLE reserves
40
            ADD COLUMN `volume_id` int(11) NULL default NULL AFTER biblionumber,
41
            ADD CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;
42
        });
43
    }
44
45
    unless ( column_exists( 'old_reserves', 'volume_id' ) ) {
46
        $dbh->do(q{
47
            ALTER TABLE old_reserves
48
            ADD COLUMN `volume_id` int(11) NULL default NULL AFTER biblionumber,
49
            ADD CONSTRAINT `old_reserves_ibfk_5` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE SET NULL ON UPDATE SET NULL;
50
        });
51
    }
52
37
    # Always end with this (adjust the bug info)
53
    # Always end with this (adjust the bug info)
38
    SetVersion( $DBversion );
54
    SetVersion( $DBversion );
39
    print "Upgrade to $DBversion done (Bug XXXXX - Add ability to define volumes for items on a record)\n";
55
    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 1801-1806 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1801
  `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron this hold is for
1801
  `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron this hold is for
1802
  `reservedate` date default NULL, -- the date the hold was placed
1802
  `reservedate` date default NULL, -- the date the hold was placed
1803
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on
1803
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on
1804
  `volume_id` int(11) NULL default NULL, -- foreign key from the volumes table defining if this is a volume level hold
1804
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1805
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1805
  `notificationdate` date default NULL, -- currently unused
1806
  `notificationdate` date default NULL, -- currently unused
1806
  `reminderdate` date default NULL, -- currently unused
1807
  `reminderdate` date default NULL, -- currently unused
Lines 1828-1834 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1828
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1829
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1829
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1830
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1830
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1831
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1831
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
1832
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE,
1833
  CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
1832
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1834
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1833
1835
1834
--
1836
--
Lines 1841-1846 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1841
  `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron this hold is for
1843
  `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron this hold is for
1842
  `reservedate` date default NULL, -- the date the hold was places
1844
  `reservedate` date default NULL, -- the date the hold was places
1843
  `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on
1845
  `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on
1846
  `volume_id` int(11) NULL default NULL, -- foreign key from the volumes table defining if this is a volume level hold
1844
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1847
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1845
  `notificationdate` date default NULL, -- currently unused
1848
  `notificationdate` date default NULL, -- currently unused
1846
  `reminderdate` date default NULL, -- currently unused
1849
  `reminderdate` date default NULL, -- currently unused
Lines 1870-1875 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1870
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1873
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1871
    ON DELETE SET NULL ON UPDATE SET NULL,
1874
    ON DELETE SET NULL ON UPDATE SET NULL,
1872
  CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
1875
  CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
1876
    ON DELETE SET NULL ON UPDATE SET NULL,
1877
  CONSTRAINT `old_reserves_ibfk_5` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`)
1873
    ON DELETE SET NULL ON UPDATE SET NULL
1878
    ON DELETE SET NULL ON UPDATE SET NULL
1874
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1879
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1875
1880
1876
- 

Return to bug 24860