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

(-)a/Koha/Schema/Result/Hold.pm (+342 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
  is_foreign_key: 1
36
  is_nullable: 1
37
38
=head2 pickup_library_id
39
40
  data_type: 'varchar'
41
  is_foreign_key: 1
42
  is_nullable: 1
43
  size: 10
44
45
=head2 created_date
46
47
  data_type: 'date'
48
  datetime_undef_if_invalid: 1
49
  is_nullable: 1
50
51
=head2 biblio_id
52
53
  data_type: 'integer'
54
  is_foreign_key: 1
55
  is_nullable: 1
56
57
=head2 item_id
58
59
  data_type: 'integer'
60
  is_foreign_key: 1
61
  is_nullable: 1
62
63
=head2 item_type
64
65
  data_type: 'varchar'
66
  is_foreign_key: 1
67
  is_nullable: 1
68
  size: 10
69
70
=head2 item_level
71
72
  data_type: 'tinyint'
73
  default_value: 0
74
  is_nullable: 0
75
76
=head2 completed_date
77
78
  data_type: 'date'
79
  datetime_undef_if_invalid: 1
80
  is_nullable: 1
81
82
=head2 notes
83
84
  data_type: 'longtext'
85
  is_nullable: 1
86
87
=head2 priority
88
89
  data_type: 'smallint'
90
  default_value: 1
91
  is_nullable: 0
92
93
=head2 status
94
95
  data_type: 'enum'
96
  default_value: 'placed'
97
  extra: {list => ["placed","fulfilled","waiting","in_transit","cancelled"]}
98
  is_nullable: 0
99
100
=head2 timestamp
101
102
  data_type: 'timestamp'
103
  datetime_undef_if_invalid: 1
104
  default_value: current_timestamp
105
  is_nullable: 0
106
107
=head2 waiting_date
108
109
  data_type: 'date'
110
  datetime_undef_if_invalid: 1
111
  is_nullable: 1
112
113
=head2 expiration_date
114
115
  data_type: 'date'
116
  datetime_undef_if_invalid: 1
117
  is_nullable: 1
118
119
=head2 lowest_priority
120
121
  data_type: 'tinyint'
122
  default_value: 0
123
  is_nullable: 0
124
125
=head2 suspended
126
127
  data_type: 'tinyint'
128
  default_value: 0
129
  is_nullable: 0
130
131
=head2 suspended_until_date
132
133
  data_type: 'datetime'
134
  datetime_undef_if_invalid: 1
135
  is_nullable: 1
136
137
=head2 completed
138
139
  data_type: 'tinyint'
140
  default_value: 0
141
  is_nullable: 0
142
143
=cut
144
145
__PACKAGE__->add_columns(
146
  "id",
147
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
148
  "patron_id",
149
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
150
  "pickup_library_id",
151
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
152
  "created_date",
153
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
154
  "biblio_id",
155
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
156
  "item_id",
157
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
158
  "item_type",
159
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
160
  "item_level",
161
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
162
  "completed_date",
163
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
164
  "notes",
165
  { data_type => "longtext", is_nullable => 1 },
166
  "priority",
167
  { data_type => "smallint", default_value => 1, is_nullable => 0 },
168
  "status",
169
  {
170
    data_type => "enum",
171
    default_value => "placed",
172
    extra => {
173
      list => ["placed", "fulfilled", "waiting", "in_transit", "cancelled"],
174
    },
175
    is_nullable => 0,
176
  },
177
  "timestamp",
178
  {
179
    data_type => "timestamp",
180
    datetime_undef_if_invalid => 1,
181
    default_value => \"current_timestamp",
182
    is_nullable => 0,
183
  },
184
  "waiting_date",
185
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
186
  "expiration_date",
187
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
188
  "lowest_priority",
189
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
190
  "suspended",
191
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
192
  "suspended_until_date",
193
  {
194
    data_type => "datetime",
195
    datetime_undef_if_invalid => 1,
196
    is_nullable => 1,
197
  },
198
  "completed",
199
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
200
);
201
202
=head1 PRIMARY KEY
203
204
=over 4
205
206
=item * L</id>
207
208
=back
209
210
=cut
211
212
__PACKAGE__->set_primary_key("id");
213
214
=head1 RELATIONS
215
216
=head2 biblio
217
218
Type: belongs_to
219
220
Related object: L<Koha::Schema::Result::Biblio>
221
222
=cut
223
224
__PACKAGE__->belongs_to(
225
  "biblio",
226
  "Koha::Schema::Result::Biblio",
227
  { biblionumber => "biblio_id" },
228
  {
229
    is_deferrable => 1,
230
    join_type     => "LEFT",
231
    on_delete     => "SET NULL",
232
    on_update     => "CASCADE",
233
  },
234
);
235
236
=head2 club_holds_to_patron_holds
237
238
Type: has_many
239
240
Related object: L<Koha::Schema::Result::ClubHoldsToPatronHold>
241
242
=cut
243
244
__PACKAGE__->has_many(
245
  "club_holds_to_patron_holds",
246
  "Koha::Schema::Result::ClubHoldsToPatronHold",
247
  { "foreign.hold_id" => "self.id" },
248
  { cascade_copy => 0, cascade_delete => 0 },
249
);
250
251
=head2 item
252
253
Type: belongs_to
254
255
Related object: L<Koha::Schema::Result::Item>
256
257
=cut
258
259
__PACKAGE__->belongs_to(
260
  "item",
261
  "Koha::Schema::Result::Item",
262
  { itemnumber => "item_id" },
263
  {
264
    is_deferrable => 1,
265
    join_type     => "LEFT",
266
    on_delete     => "SET NULL",
267
    on_update     => "CASCADE",
268
  },
269
);
270
271
=head2 item_type
272
273
Type: belongs_to
274
275
Related object: L<Koha::Schema::Result::Itemtype>
276
277
=cut
278
279
__PACKAGE__->belongs_to(
280
  "item_type",
281
  "Koha::Schema::Result::Itemtype",
282
  { itemtype => "item_type" },
283
  {
284
    is_deferrable => 1,
285
    join_type     => "LEFT",
286
    on_delete     => "SET NULL",
287
    on_update     => "CASCADE",
288
  },
289
);
290
291
=head2 patron
292
293
Type: belongs_to
294
295
Related object: L<Koha::Schema::Result::Borrower>
296
297
=cut
298
299
__PACKAGE__->belongs_to(
300
  "patron",
301
  "Koha::Schema::Result::Borrower",
302
  { borrowernumber => "patron_id" },
303
  {
304
    is_deferrable => 1,
305
    join_type     => "LEFT",
306
    on_delete     => "SET NULL",
307
    on_update     => "CASCADE",
308
  },
309
);
310
311
=head2 pickup_library
312
313
Type: belongs_to
314
315
Related object: L<Koha::Schema::Result::Branch>
316
317
=cut
318
319
__PACKAGE__->belongs_to(
320
  "pickup_library",
321
  "Koha::Schema::Result::Branch",
322
  { branchcode => "pickup_library_id" },
323
  {
324
    is_deferrable => 1,
325
    join_type     => "LEFT",
326
    on_delete     => "SET NULL",
327
    on_update     => "CASCADE",
328
  },
329
);
330
331
332
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-30 17:15:25
333
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:o1CEfGWt/7y/b874XJse5w
334
335
__PACKAGE__->add_columns(
336
    '+completed'  => { is_boolean => 1 },
337
    '+item_level' => { is_boolean => 1 },
338
    '+suspended'  => { is_boolean => 1 },
339
    '+lowest_priority' => { is_boolean => 1 },
340
);
341
342
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
    `created_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
    `completed_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
        `created_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
        `created_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
                `completed_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