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

(-)a/Koha/Schema/Result/Hold.pm (+344 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::Hold;
3
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7
=head1 NAME
8
9
Koha::Schema::Result::Hold
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<holds>
19
20
=cut
21
22
__PACKAGE__->table("holds");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
=head2 patron_id
33
34
  data_type: 'integer'
35
  default_value: 0
36
  is_foreign_key: 1
37
  is_nullable: 0
38
39
=head2 pickup_library_id
40
41
  data_type: 'varchar'
42
  is_foreign_key: 1
43
  is_nullable: 1
44
  size: 10
45
46
=head2 placing_date
47
48
  data_type: 'date'
49
  datetime_undef_if_invalid: 1
50
  is_nullable: 1
51
52
=head2 biblio_id
53
54
  data_type: 'integer'
55
  default_value: 0
56
  is_foreign_key: 1
57
  is_nullable: 0
58
59
=head2 item_id
60
61
  data_type: 'integer'
62
  is_foreign_key: 1
63
  is_nullable: 1
64
65
=head2 item_type
66
67
  data_type: 'varchar'
68
  is_foreign_key: 1
69
  is_nullable: 1
70
  size: 10
71
72
=head2 item_level
73
74
  data_type: 'tinyint'
75
  default_value: 0
76
  is_nullable: 0
77
78
=head2 completion_date
79
80
  data_type: 'date'
81
  datetime_undef_if_invalid: 1
82
  is_nullable: 1
83
84
=head2 notes
85
86
  data_type: 'longtext'
87
  is_nullable: 1
88
89
=head2 priority
90
91
  data_type: 'smallint'
92
  default_value: 1
93
  is_nullable: 0
94
95
=head2 status
96
97
  data_type: 'enum'
98
  default_value: 'placed'
99
  extra: {list => ["placed","fulfilled","waiting","in_transit","cancelled"]}
100
  is_nullable: 1
101
102
=head2 timestamp
103
104
  data_type: 'timestamp'
105
  datetime_undef_if_invalid: 1
106
  default_value: current_timestamp
107
  is_nullable: 0
108
109
=head2 waiting_date
110
111
  data_type: 'date'
112
  datetime_undef_if_invalid: 1
113
  is_nullable: 1
114
115
=head2 expiration_date
116
117
  data_type: 'date'
118
  datetime_undef_if_invalid: 1
119
  is_nullable: 1
120
121
=head2 lowest_priority
122
123
  data_type: 'tinyint'
124
  default_value: 0
125
  is_nullable: 0
126
127
=head2 suspended
128
129
  data_type: 'tinyint'
130
  default_value: 0
131
  is_nullable: 0
132
133
=head2 suspended_until_date
134
135
  data_type: 'datetime'
136
  datetime_undef_if_invalid: 1
137
  is_nullable: 1
138
139
=head2 completed
140
141
  data_type: 'tinyint'
142
  default_value: 0
143
  is_nullable: 0
144
145
=cut
146
147
__PACKAGE__->add_columns(
148
  "id",
149
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
150
  "patron_id",
151
  {
152
    data_type      => "integer",
153
    default_value  => 0,
154
    is_foreign_key => 1,
155
    is_nullable    => 0,
156
  },
157
  "pickup_library_id",
158
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
159
  "placing_date",
160
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
161
  "biblio_id",
162
  {
163
    data_type      => "integer",
164
    default_value  => 0,
165
    is_foreign_key => 1,
166
    is_nullable    => 0,
167
  },
168
  "item_id",
169
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
170
  "item_type",
171
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
172
  "item_level",
173
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
174
  "completion_date",
175
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
176
  "notes",
177
  { data_type => "longtext", is_nullable => 1 },
178
  "priority",
179
  { data_type => "smallint", default_value => 1, is_nullable => 0 },
180
  "status",
181
  {
182
    data_type => "enum",
183
    default_value => "placed",
184
    extra => {
185
      list => ["placed", "fulfilled", "waiting", "in_transit", "cancelled"],
186
    },
187
    is_nullable => 1,
188
  },
189
  "timestamp",
190
  {
191
    data_type => "timestamp",
192
    datetime_undef_if_invalid => 1,
193
    default_value => \"current_timestamp",
194
    is_nullable => 0,
195
  },
196
  "waiting_date",
197
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
198
  "expiration_date",
199
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
200
  "lowest_priority",
201
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
202
  "suspended",
203
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
204
  "suspended_until_date",
205
  {
206
    data_type => "datetime",
207
    datetime_undef_if_invalid => 1,
208
    is_nullable => 1,
209
  },
210
  "completed",
211
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
212
);
213
214
=head1 PRIMARY KEY
215
216
=over 4
217
218
=item * L</id>
219
220
=back
221
222
=cut
223
224
__PACKAGE__->set_primary_key("id");
225
226
=head1 RELATIONS
227
228
=head2 biblio
229
230
Type: belongs_to
231
232
Related object: L<Koha::Schema::Result::Biblio>
233
234
=cut
235
236
__PACKAGE__->belongs_to(
237
  "biblio",
238
  "Koha::Schema::Result::Biblio",
239
  { biblionumber => "biblio_id" },
240
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
241
);
242
243
=head2 club_holds_to_patron_holds
244
245
Type: has_many
246
247
Related object: L<Koha::Schema::Result::ClubHoldsToPatronHold>
248
249
=cut
250
251
__PACKAGE__->has_many(
252
  "club_holds_to_patron_holds",
253
  "Koha::Schema::Result::ClubHoldsToPatronHold",
254
  { "foreign.hold_id" => "self.id" },
255
  { cascade_copy => 0, cascade_delete => 0 },
256
);
257
258
=head2 item
259
260
Type: belongs_to
261
262
Related object: L<Koha::Schema::Result::Item>
263
264
=cut
265
266
__PACKAGE__->belongs_to(
267
  "item",
268
  "Koha::Schema::Result::Item",
269
  { itemnumber => "item_id" },
270
  {
271
    is_deferrable => 1,
272
    join_type     => "LEFT",
273
    on_delete     => "CASCADE",
274
    on_update     => "CASCADE",
275
  },
276
);
277
278
=head2 item_type
279
280
Type: belongs_to
281
282
Related object: L<Koha::Schema::Result::Itemtype>
283
284
=cut
285
286
__PACKAGE__->belongs_to(
287
  "item_type",
288
  "Koha::Schema::Result::Itemtype",
289
  { itemtype => "item_type" },
290
  {
291
    is_deferrable => 1,
292
    join_type     => "LEFT",
293
    on_delete     => "CASCADE",
294
    on_update     => "CASCADE",
295
  },
296
);
297
298
=head2 patron
299
300
Type: belongs_to
301
302
Related object: L<Koha::Schema::Result::Borrower>
303
304
=cut
305
306
__PACKAGE__->belongs_to(
307
  "patron",
308
  "Koha::Schema::Result::Borrower",
309
  { borrowernumber => "patron_id" },
310
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
311
);
312
313
=head2 pickup_library
314
315
Type: belongs_to
316
317
Related object: L<Koha::Schema::Result::Branch>
318
319
=cut
320
321
__PACKAGE__->belongs_to(
322
  "pickup_library",
323
  "Koha::Schema::Result::Branch",
324
  { branchcode => "pickup_library_id" },
325
  {
326
    is_deferrable => 1,
327
    join_type     => "LEFT",
328
    on_delete     => "CASCADE",
329
    on_update     => "CASCADE",
330
  },
331
);
332
333
334
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-22 19:21:03
335
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rpFBfRe1swRgNQsdQPiTtg
336
337
__PACKAGE__->add_columns(
338
    '+completed'  => { is_boolean => 1 },
339
    '+item_level' => { is_boolean => 1 },
340
    '+suspended'  => { is_boolean => 1 },
341
    '+lowest_priority' => { is_boolean => 1 },
342
);
343
344
1;
(-)a/installer/data/mysql/kohastructure.sql (-79 / +128 lines)
Lines 1737-1823 CREATE TABLE `patronimage` ( -- information related to patron images Link Here
1737
  CONSTRAINT `patronimage_fk1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
1737
  CONSTRAINT `patronimage_fk1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
1738
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1738
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1739
1739
1740
--
1741
-- Table structure for table `holds`
1742
--
1743
1744
DROP TABLE IF EXISTS `holds`;
1745
CREATE TABLE `holds` (
1746
    -- information related to holds in Koha
1747
    `id` INT(11) NOT NULL AUTO_INCREMENT,
1748
    -- primary key
1749
    `patron_id` INT(11) DEFAULT NULL,
1750
    -- foreign key from the borrowers table defining which patron this hold is for
1751
    `pickup_library_id` VARCHAR(10) DEFAULT NULL,
1752
    -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1753
    `placing_date` DATE DEFAULT NULL,
1754
    -- the date the hold was placed
1755
    `biblio_id` INT(11) DEFAULT NULL,
1756
    -- foreign key from the biblio table defining which bib record this hold is on
1757
    `item_id` INT(11) DEFAULT NULL,
1758
    -- foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with
1759
    `item_type` VARCHAR(10) DEFAULT NULL,
1760
    -- If record level hold, the optional itemtype of the item the patron is requesting
1761
    `item_level` TINYINT(1) NOT NULL DEFAULT 0,
1762
    -- Is the hold was placed at item level
1763
    `completion_date` DATE DEFAULT NULL,
1764
    -- the date this hold was completed (fulfilled or cancelled)
1765
    `notes` LONGTEXT,
1766
    -- notes related to this hold
1767
    `priority` SMALLINT(6) NOT NULL DEFAULT 1,
1768
    -- where in the queue the patron sits
1769
    `status` ENUM('placed', 'fulfilled', 'waiting', 'in_transit', 'cancelled') DEFAULT 'placed' NOT NULL,
1770
    -- the status the hold is ('placed', 'fulfilled', 'waiting', 'in_transit', 'cancelled')
1771
    `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1772
    -- the date and time this hold was last updated
1773
    `waiting_date` DATE DEFAULT NULL,
1774
    -- the date the item was marked as waiting for the patron at the library
1775
    `expiration_date` DATE DEFAULT NULL,
1776
    -- the date the hold expires (usually the date entered by the patron to say they don't need the hold after a certain date)
1777
    `lowest_priority` TINYINT(1) NOT NULL DEFAULT 0,
1778
    -- If it was assigned the lowest priority
1779
    `suspended` TINYINT(1) NOT NULL DEFAULT 0,
1780
    -- If it is suspended
1781
    `suspended_until_date` DATETIME NULL DEFAULT NULL,
1782
    -- Date until it is suspended
1783
    `completed` TINYINT(1) NOT NULL DEFAULT 0,
1784
    -- If it has been completed (i.e. either 'fulfilled' or 'cancelled')
1785
    PRIMARY KEY (`id`),
1786
    KEY `priority_status_idx` (`priority`, `status`),
1787
    KEY `patron_id` (`patron_id`),
1788
    KEY `biblio_id` (`biblio_id`),
1789
    KEY `item_id` (`item_id`),
1790
    KEY `pickup_library_id` (`pickup_library_id`),
1791
    KEY `item_type` (`item_type`),
1792
    CONSTRAINT `holds_ibfk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
1793
    CONSTRAINT `holds_ibfk_2` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
1794
    CONSTRAINT `holds_ibfk_3` FOREIGN KEY (`item_id`)   REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE,
1795
    CONSTRAINT `holds_ibfk_4` FOREIGN KEY (`pickup_library_id`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE,
1796
    CONSTRAINT `holds_ibfk_5` FOREIGN KEY (`item_type`) REFERENCES `itemtypes` (`itemtype`) ON DELETE SET NULL ON UPDATE CASCADE
1797
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
1798
1740
--
1799
--
1741
-- Table structure for table `reserves`
1800
-- Table structure for table `reserves`
1742
--
1801
--
1743
1802
1744
DROP TABLE IF EXISTS `reserves`;
1803
CREATE VIEW `reserves`
1745
CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha
1804
AS
1746
  `reserve_id` int(11) NOT NULL auto_increment, -- primary key
1805
    SELECT
1747
  `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron this hold is for
1806
        `id` AS `reserve_id`,
1748
  `reservedate` date default NULL, -- the date the hold was placed
1807
        `patron_id` AS `borrowernumber`,
1749
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on
1808
        `placing_date` AS `reservedate`,
1750
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1809
        `biblio_id` AS `biblionumber`,
1751
  `notificationdate` date default NULL, -- currently unused
1810
        `pickup_library_id` AS `branchcode`,
1752
  `reminderdate` date default NULL, -- currently unused
1811
        NULL AS `cancellationdate`,
1753
  `cancellationdate` date default NULL, -- the date this hold was cancelled
1812
        `notes` AS `reservenotes`,
1754
  `reservenotes` LONGTEXT, -- notes related to this hold
1813
        `priority`,
1755
  `priority` smallint(6) NOT NULL DEFAULT 1, -- where in the queue the patron sits
1814
        CASE
1756
  `found` varchar(1) default NULL, -- a one letter code defining what the status is of the hold is after it has been confirmed
1815
            when `status` = 'waiting' then
1757
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this hold was last updated
1816
                'W'
1758
  `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with
1817
            when `status` = 'in_transit' then
1759
  `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1818
                'T'
1760
  `expirationdate` DATE DEFAULT NULL, -- the date the hold expires (usually the date entered by the patron to say they don't need the hold after a certain date)
1819
            else
1761
  `lowestPriority` tinyint(1) NOT NULL DEFAULT 0,
1820
                NULL
1762
  `suspend` tinyint(1) NOT NULL DEFAULT 0,
1821
        END AS `found`,
1763
  `suspend_until` DATETIME NULL DEFAULT NULL,
1822
        `timestamp`,
1764
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1823
        `item_id` AS `itemnumber`,
1765
  `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1824
        `waiting_date` AS `waitingdate`,
1766
  PRIMARY KEY (`reserve_id`),
1825
        `expiration_date` AS `expirationdate`,
1767
  KEY priorityfoundidx (priority,found),
1826
        `lowest_priority` AS `lowestPriority`,
1768
  KEY `borrowernumber` (`borrowernumber`),
1827
        `suspended` AS `suspend`,
1769
  KEY `biblionumber` (`biblionumber`),
1828
        `suspended_until_date` AS `suspend_until`,
1770
  KEY `itemnumber` (`itemnumber`),
1829
        `item_type` AS `itemtype`,
1771
  KEY `branchcode` (`branchcode`),
1830
        `item_level` AS `item_level_hold`
1772
  KEY `itemtype` (`itemtype`),
1831
    FROM `holds`
1773
  CONSTRAINT `reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1832
    WHERE completed=0;
1774
  CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1833
1775
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1834
--
1776
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1835
-- Table structure for view `old_reserves`
1777
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
1836
--
1778
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1837
1779
1838
CREATE VIEW `old_reserves`
1780
--
1839
AS
1781
-- Table structure for table `old_reserves`
1840
    SELECT
1782
--
1841
        `id` AS `reserve_id`,
1783
1842
        `patron_id` AS `borrowernumber`,
1784
DROP TABLE IF EXISTS `old_reserves`;
1843
        `placing_date` AS `reservedate`,
1785
CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have been completed (either filled or cancelled)
1844
        `biblio_id` AS `biblionumber`,
1786
  `reserve_id` int(11) NOT NULL, -- primary key
1845
        `pickup_library_id` AS `branchcode`,
1787
  `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron this hold is for
1846
        CASE
1788
  `reservedate` date default NULL, -- the date the hold was places
1847
            WHEN `status` = 'cancelled' THEN
1789
  `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on
1848
                `completion_date`
1790
  `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at
1849
            ELSE
1791
  `notificationdate` date default NULL, -- currently unused
1850
                NULL
1792
  `reminderdate` date default NULL, -- currently unused
1851
        END AS `cancellationdate`,
1793
  `cancellationdate` date default NULL, -- the date this hold was cancelled
1852
        `notes` AS `reservenotes`,
1794
  `reservenotes` LONGTEXT, -- notes related to this hold
1853
        `priority`,
1795
  `priority` smallint(6) NOT NULL DEFAULT 1, -- where in the queue the patron sits
1854
        CASE
1796
  `found` varchar(1) default NULL, -- a one letter code defining what the status is of the hold is after it has been confirmed
1855
            WHEN `status` = 'fulfilled' THEN
1797
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this hold was last updated
1856
                'F'
1798
  `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with
1857
            ELSE
1799
  `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1858
                NULL
1800
  `expirationdate` DATE DEFAULT NULL, -- the date the hold expires (usually the date entered by the patron to say they don't need the hold after a certain date)
1859
        END AS `found`,
1801
  `lowestPriority` tinyint(1) NOT NULL DEFAULT 0, -- has this hold been pinned to the lowest priority in the holds queue (1 for yes, 0 for no)
1860
        `timestamp`,
1802
  `suspend` tinyint(1) NOT NULL DEFAULT 0, -- in this hold suspended (1 for yes, 0 for no)
1861
        `item_id` AS `itemnumber`,
1803
  `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely)
1862
        `waiting_date` AS `waitingdate`,
1804
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1863
        `expiration_date` AS `expirationdate`,
1805
  `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1864
        `lowest_priority` AS `lowestPriority`,
1806
  PRIMARY KEY (`reserve_id`),
1865
        `suspended` AS `suspend`,
1807
  KEY `old_reserves_borrowernumber` (`borrowernumber`),
1866
        `suspended_until_date` AS `suspend_until`,
1808
  KEY `old_reserves_biblionumber` (`biblionumber`),
1867
        `item_type` AS `itemtype`,
1809
  KEY `old_reserves_itemnumber` (`itemnumber`),
1868
        `item_level` AS `item_level_hold`
1810
  KEY `old_reserves_branchcode` (`branchcode`),
1869
    FROM `holds`
1811
  KEY `old_reserves_itemtype` (`itemtype`),
1870
    WHERE completed=1;
1812
  CONSTRAINT `old_reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
1813
    ON DELETE SET NULL ON UPDATE SET NULL,
1814
  CONSTRAINT `old_reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`)
1815
    ON DELETE SET NULL ON UPDATE SET NULL,
1816
  CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1817
    ON DELETE SET NULL ON UPDATE SET NULL,
1818
  CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
1819
    ON DELETE SET NULL ON UPDATE SET NULL
1820
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1821
1871
1822
--
1872
--
1823
-- Table structure for table `reviews`
1873
-- Table structure for table `reviews`
Lines 4108-4114 CREATE TABLE IF NOT EXISTS club_holds_to_patron_holds ( Link Here
4108
    -- KEY club_hold_id (club_hold_id),
4158
    -- KEY club_hold_id (club_hold_id),
4109
    CONSTRAINT clubs_holds_paton_holds_ibfk_1 FOREIGN KEY (club_hold_id) REFERENCES club_holds (id) ON DELETE CASCADE ON UPDATE CASCADE,
4159
    CONSTRAINT clubs_holds_paton_holds_ibfk_1 FOREIGN KEY (club_hold_id) REFERENCES club_holds (id) ON DELETE CASCADE ON UPDATE CASCADE,
4110
    CONSTRAINT clubs_holds_paton_holds_ibfk_2 FOREIGN KEY (patron_id) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
4160
    CONSTRAINT clubs_holds_paton_holds_ibfk_2 FOREIGN KEY (patron_id) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
4111
    CONSTRAINT clubs_holds_paton_holds_ibfk_3 FOREIGN KEY (hold_id) REFERENCES reserves (reserve_id) ON DELETE CASCADE ON UPDATE CASCADE
4161
    CONSTRAINT clubs_holds_paton_holds_ibfk_3 FOREIGN KEY (hold_id) REFERENCES holds (id) ON DELETE CASCADE ON UPDATE CASCADE
4112
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4162
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4113
4163
4114
--
4164
--
4115
- 

Return to bug 25260