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

(-)a/Koha/Schema/Result/Biblio.pm (-2 / +17 lines)
Lines 255-260 __PACKAGE__->has_many( Link Here
255
  { cascade_copy => 0, cascade_delete => 0 },
255
  { cascade_copy => 0, cascade_delete => 0 },
256
);
256
);
257
257
258
=head2 bookings
259
260
Type: has_many
261
262
Related object: L<Koha::Schema::Result::Booking>
263
264
=cut
265
266
__PACKAGE__->has_many(
267
  "bookings",
268
  "Koha::Schema::Result::Booking",
269
  { "foreign.biblio_id" => "self.biblionumber" },
270
  { cascade_copy => 0, cascade_delete => 0 },
271
);
272
258
=head2 club_holds
273
=head2 club_holds
259
274
260
Type: has_many
275
Type: has_many
Lines 601-608 __PACKAGE__->has_many( Link Here
601
);
616
);
602
617
603
618
604
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-05-05 12:10:09
619
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-05-09 07:11:30
605
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xDa15D5QckMdwVzVy4FX2g
620
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AZgt+4mVV/QYtSsdhxmaBQ
606
621
607
__PACKAGE__->has_many(
622
__PACKAGE__->has_many(
608
  "biblioitem",
623
  "biblioitem",
(-)a/Koha/Schema/Result/Booking.pm (+181 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::Booking;
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::Booking
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<bookings>
19
20
=cut
21
22
__PACKAGE__->table("bookings");
23
24
=head1 ACCESSORS
25
26
=head2 booking_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
primary key
33
34
=head2 patron_id
35
36
  data_type: 'integer'
37
  default_value: 0
38
  is_foreign_key: 1
39
  is_nullable: 0
40
41
foreign key from the borrowers table defining which patron this booking is for
42
43
=head2 biblio_id
44
45
  data_type: 'integer'
46
  default_value: 0
47
  is_foreign_key: 1
48
  is_nullable: 0
49
50
foreign key from the biblio table defining which bib record this booking is on
51
52
=head2 item_id
53
54
  data_type: 'integer'
55
  is_foreign_key: 1
56
  is_nullable: 1
57
58
foreign key from the items table defining the specific item the patron has placed a booking for
59
60
=head2 start_date
61
62
  data_type: 'datetime'
63
  datetime_undef_if_invalid: 1
64
  is_nullable: 1
65
66
the start date of the booking
67
68
=head2 end_date
69
70
  data_type: 'datetime'
71
  datetime_undef_if_invalid: 1
72
  is_nullable: 1
73
74
the end date of the booking
75
76
=cut
77
78
__PACKAGE__->add_columns(
79
  "booking_id",
80
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
81
  "patron_id",
82
  {
83
    data_type      => "integer",
84
    default_value  => 0,
85
    is_foreign_key => 1,
86
    is_nullable    => 0,
87
  },
88
  "biblio_id",
89
  {
90
    data_type      => "integer",
91
    default_value  => 0,
92
    is_foreign_key => 1,
93
    is_nullable    => 0,
94
  },
95
  "item_id",
96
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
97
  "start_date",
98
  {
99
    data_type => "datetime",
100
    datetime_undef_if_invalid => 1,
101
    is_nullable => 1,
102
  },
103
  "end_date",
104
  {
105
    data_type => "datetime",
106
    datetime_undef_if_invalid => 1,
107
    is_nullable => 1,
108
  },
109
);
110
111
=head1 PRIMARY KEY
112
113
=over 4
114
115
=item * L</booking_id>
116
117
=back
118
119
=cut
120
121
__PACKAGE__->set_primary_key("booking_id");
122
123
=head1 RELATIONS
124
125
=head2 biblio
126
127
Type: belongs_to
128
129
Related object: L<Koha::Schema::Result::Biblio>
130
131
=cut
132
133
__PACKAGE__->belongs_to(
134
  "biblio",
135
  "Koha::Schema::Result::Biblio",
136
  { biblionumber => "biblio_id" },
137
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
138
);
139
140
=head2 item
141
142
Type: belongs_to
143
144
Related object: L<Koha::Schema::Result::Item>
145
146
=cut
147
148
__PACKAGE__->belongs_to(
149
  "item",
150
  "Koha::Schema::Result::Item",
151
  { itemnumber => "item_id" },
152
  {
153
    is_deferrable => 1,
154
    join_type     => "LEFT",
155
    on_delete     => "CASCADE",
156
    on_update     => "CASCADE",
157
  },
158
);
159
160
=head2 patron
161
162
Type: belongs_to
163
164
Related object: L<Koha::Schema::Result::Borrower>
165
166
=cut
167
168
__PACKAGE__->belongs_to(
169
  "patron",
170
  "Koha::Schema::Result::Borrower",
171
  { borrowernumber => "patron_id" },
172
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
173
);
174
175
176
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-11-04 10:01:46
177
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LoOYu7IflBkC4+VUZLd+Tg
178
179
180
# You can replace this text with custom code or comments, and it will be preserved on regeneration
181
1;
(-)a/Koha/Schema/Result/Borrower.pm (-2 / +17 lines)
Lines 1057-1062 __PACKAGE__->has_many( Link Here
1057
  { cascade_copy => 0, cascade_delete => 0 },
1057
  { cascade_copy => 0, cascade_delete => 0 },
1058
);
1058
);
1059
1059
1060
=head2 bookings
1061
1062
Type: has_many
1063
1064
Related object: L<Koha::Schema::Result::Booking>
1065
1066
=cut
1067
1068
__PACKAGE__->has_many(
1069
  "bookings",
1070
  "Koha::Schema::Result::Booking",
1071
  { "foreign.patron_id" => "self.borrowernumber" },
1072
  { cascade_copy => 0, cascade_delete => 0 },
1073
);
1074
1060
=head2 borrower_attributes
1075
=head2 borrower_attributes
1061
1076
1062
Type: has_many
1077
Type: has_many
Lines 2103-2110 Composing rels: L</user_permissions> -> permission Link Here
2103
__PACKAGE__->many_to_many("permissions", "user_permissions", "permission");
2118
__PACKAGE__->many_to_many("permissions", "user_permissions", "permission");
2104
2119
2105
2120
2106
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-04-06 15:46:57
2121
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-05-09 07:11:30
2107
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f6omVb7EtiysdaWTX3IRzg
2122
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6Dg1BEP0T6C3J6hQPn4Wkw
2108
2123
2109
__PACKAGE__->has_many(
2124
__PACKAGE__->has_many(
2110
  "restrictions",
2125
  "restrictions",
(-)a/Koha/Schema/Result/Item.pm (-1 / +15 lines)
Lines 602-607 __PACKAGE__->belongs_to( Link Here
602
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
602
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
603
);
603
);
604
604
605
=head2 bookings
606
607
Type: has_many
608
609
Related object: L<Koha::Schema::Result::Booking>
610
611
=cut
612
613
__PACKAGE__->has_many(
614
  "bookings",
615
  "Koha::Schema::Result::Booking",
616
  { "foreign.item_id" => "self.itemnumber" },
617
  { cascade_copy => 0, cascade_delete => 0 },
618
);
619
605
=head2 branchtransfers
620
=head2 branchtransfers
606
621
607
Type: has_many
622
Type: has_many
608
- 

Return to bug 29002