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

(-)a/installer/data/mysql/atomicupdate/bug_19532_-_add_old_recalls_table.sql (+27 lines)
Line 0 Link Here
1
DROP TABLE IF EXISTS `old_recalls`;
2
CREATE TABLE `old_recalls` ( -- information related to old recalls in Koha for statistics purposes
3
    `recall_id` int(11) NOT NULL auto_increment, -- primary key
4
    `borrowernumber` int(11) NULL default 0, -- foreign key from the borrowers table defining which patron requested a recall
5
    `recalldate` date default NULL, -- the date the recall request was placed
6
    `biblionumber` int(11) NULL default 0, -- foreign key from the biblio table defining which bib record this request is for
7
    `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick up their recall from
8
    `cancellationdate` date default NULL, -- the date this recall was cancelled
9
    `recallnotes` mediumtext, -- notes related to this recall
10
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
11
    `found` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired
12
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
13
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
14
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
15
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
16
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
17
    PRIMARY KEY (`recall_id`),
18
    KEY `old_recalls_borrowernumber` (`borrowernumber`),
19
    KEY `old_recalls_biblionumber` (`biblionumber`),
20
    KEY `old_recalls_itemnumber` (`itemnumber`),
21
    KEY `old_recalls_branchcode` (`branchcode`),
22
    KEY `old_recalls_itemtype` (`itemtype`),
23
    CONSTRAINT `old_recalls_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL,
24
    CONSTRAINT `old_recalls_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE SET NULL,
25
    CONSTRAINT `old_recalls_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL,
26
    CONSTRAINT `old_recalls_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE SET NULL ON UPDATE SET NULL
27
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
(-)a/installer/data/mysql/atomicupdate/bug_19532_-_add_recalls_table.sql (+29 lines)
Line 0 Link Here
1
DROP TABLE IF EXISTS `recalls`;
2
CREATE TABLE `recalls` ( -- information related to recalls in Koha
3
    `recall_id` int(11) NOT NULL auto_increment, -- primary key
4
    `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron requested a recall
5
    `recalldate` date default NULL, -- the date the recall request was placed
6
    `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this request is for
7
    `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick up their recall from
8
    `cancellationdate` date default NULL, -- the date this recall was cancelled
9
    `recallnotes` mediumtext, -- notes related to this recall
10
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
11
    `found` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired
12
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
13
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
14
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
15
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
16
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
17
    PRIMARY KEY (`recall_id`),
18
    KEY `priorityfoundidx` (priority,found),
19
    KEY `borrowernumber` (`borrowernumber`),
20
    KEY `biblionumber` (`biblionumber`),
21
    KEY `itemnumber` (`itemnumber`),
22
    KEY `branchcode` (`branchcode`),
23
    KEY `itemtype` (`itemtype`),
24
    CONSTRAINT `recalls_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
25
    CONSTRAINT `recalls_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
26
    CONSTRAINT `recalls_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
27
    CONSTRAINT `recalls_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
28
    CONSTRAINT `recalls_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
29
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
(-)a/installer/data/mysql/kohastructure.sql (-1 / +66 lines)
Lines 1871-1876 CREATE TABLE `patronimage` ( -- information related to patron images Link Here
1871
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1871
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1872
1872
1873
--
1873
--
1874
-- Table structure for table `recalls`
1875
--
1876
1877
DROP TABLE IF EXISTS `recalls`;
1878
CREATE TABLE `recalls` ( -- information related to recalls in Koha
1879
    `recall_id` int(11) NOT NULL auto_increment, -- primary key
1880
    `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron requested a recall
1881
    `recalldate` date default NULL, -- the date the recall request was placed
1882
    `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this request is for
1883
    `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick up their recall from
1884
    `cancellationdate` date default NULL, -- the date this recall was cancelled
1885
    `recallnotes` mediumtext, -- notes related to this recall
1886
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
1887
    `found` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired
1888
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
1889
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
1890
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1891
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
1892
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
1893
    PRIMARY KEY (`recall_id`),
1894
    KEY `priorityfoundidx` (priority,found),
1895
    KEY `borrowernumber` (`borrowernumber`),
1896
    KEY `biblionumber` (`biblionumber`),
1897
    KEY `itemnumber` (`itemnumber`),
1898
    KEY `branchcode` (`branchcode`),
1899
    KEY `itemtype` (`itemtype`),
1900
    CONSTRAINT `recalls_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1901
    CONSTRAINT `recalls_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1902
    CONSTRAINT `recalls_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1903
    CONSTRAINT `recalls_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1904
    CONSTRAINT `recalls_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
1905
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1906
1907
--
1908
-- Table structure for table `old_recalls`
1909
--
1910
1911
DROP TABLE IF EXISTS `old_recalls`;
1912
CREATE TABLE `old_recalls` ( -- information related to recalls in Koha
1913
    `recall_id` int(11) NOT NULL auto_increment, -- primary key
1914
    `borrowernumber` int(11) NULL default 0, -- foreign key from the borrowers table defining which patron requested a recall
1915
    `recalldate` date default NULL, -- the date the recall request was placed
1916
    `biblionumber` int(11) NULL default 0, -- foreign key from the biblio table defining which bib record this request is for
1917
    `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick up their recall from
1918
    `cancellationdate` date default NULL, -- the date this recall was cancelled
1919
    `recallnotes` mediumtext, -- notes related to this recall
1920
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
1921
    `found` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired
1922
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
1923
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
1924
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1925
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
1926
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
1927
    PRIMARY KEY (`recall_id`),
1928
    KEY `old_recalls_borrowernumber` (`borrowernumber`),
1929
    KEY `old_recalls_biblionumber` (`biblionumber`),
1930
    KEY `old_recalls_itemnumber` (`itemnumber`),
1931
    KEY `old_recalls_branchcode` (`branchcode`),
1932
    KEY `old_recalls_itemtype` (`itemtype`),
1933
    CONSTRAINT `old_recalls_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1934
    CONSTRAINT `old_recalls_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1935
    CONSTRAINT `old_recalls_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1936
    CONSTRAINT `old_recalls_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE SET NULL ON UPDATE SET NULL
1937
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1938
1939
--
1874
-- Table structure for table `reserves`
1940
-- Table structure for table `reserves`
1875
--
1941
--
1876
1942
1877
- 

Return to bug 19532