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 1795-1800 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1795
  `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron this hold is for
1795
  `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron this hold is for
1796
  `reservedate` date default NULL, -- the date the hold was placed
1796
  `reservedate` date default NULL, -- the date the hold was placed
1797
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on
1797
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on
1798
  `volume_id` int(11) NULL default NULL, -- foreign key from the volumes table defining if this is a volume level hold
1798
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1799
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1799
  `notificationdate` date default NULL, -- currently unused
1800
  `notificationdate` date default NULL, -- currently unused
1800
  `reminderdate` date default NULL, -- currently unused
1801
  `reminderdate` date default NULL, -- currently unused
Lines 1822-1828 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1822
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1823
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1823
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1824
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1824
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1825
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1825
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
1826
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE,
1827
  CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
1826
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1828
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1827
1829
1828
--
1830
--
Lines 1835-1840 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1835
  `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron this hold is for
1837
  `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron this hold is for
1836
  `reservedate` date default NULL, -- the date the hold was places
1838
  `reservedate` date default NULL, -- the date the hold was places
1837
  `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on
1839
  `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on
1840
  `volume_id` int(11) NULL default NULL, -- foreign key from the volumes table defining if this is a volume level hold
1838
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1841
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1839
  `notificationdate` date default NULL, -- currently unused
1842
  `notificationdate` date default NULL, -- currently unused
1840
  `reminderdate` date default NULL, -- currently unused
1843
  `reminderdate` date default NULL, -- currently unused
Lines 1864-1869 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1864
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1867
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1865
    ON DELETE SET NULL ON UPDATE SET NULL,
1868
    ON DELETE SET NULL ON UPDATE SET NULL,
1866
  CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
1869
  CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
1870
    ON DELETE SET NULL ON UPDATE SET NULL,
1871
  CONSTRAINT `old_reserves_ibfk_5` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`)
1867
    ON DELETE SET NULL ON UPDATE SET NULL
1872
    ON DELETE SET NULL ON UPDATE SET NULL
1868
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1873
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1869
1874
1870
- 

Return to bug 24860