Bug 16787: DBIC schema changes
[koha.git] / Koha / Schema / Result / ClubHoldsToPatronHold.pm
1 use utf8;
2 package Koha::Schema::Result::ClubHoldsToPatronHold;
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::ClubHoldsToPatronHold
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<club_holds_to_patron_holds>
19
20 =cut
21
22 __PACKAGE__->table("club_holds_to_patron_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 club_hold_id
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 0
37
38 =head2 patron_id
39
40   data_type: 'integer'
41   is_foreign_key: 1
42   is_nullable: 0
43
44 =head2 hold_id
45
46   data_type: 'integer'
47   is_foreign_key: 1
48   is_nullable: 1
49
50 =head2 error_code
51
52   data_type: 'enum'
53   extra: {list => ["damaged","ageRestricted","itemAlreadyOnHold","tooManyHoldsForThisRecord","tooManyReservesToday","tooManyReserves","notReservable","cannotReserveFromOtherBranches","libraryNotFound","libraryNotPickupLocation","cannotBeTransferred","noReservesAllowed"]}
54   is_nullable: 1
55
56 =head2 error_message
57
58   data_type: 'varchar'
59   is_nullable: 1
60   size: 100
61
62 =cut
63
64 __PACKAGE__->add_columns(
65   "id",
66   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
67   "club_hold_id",
68   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
69   "patron_id",
70   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
71   "hold_id",
72   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
73   "error_code",
74   {
75     data_type => "enum",
76     extra => {
77       list => [
78         "damaged",
79         "ageRestricted",
80         "itemAlreadyOnHold",
81         "tooManyHoldsForThisRecord",
82         "tooManyReservesToday",
83         "tooManyReserves",
84         "notReservable",
85         "cannotReserveFromOtherBranches",
86         "libraryNotFound",
87         "libraryNotPickupLocation",
88         "cannotBeTransferred",
89         "noReservesAllowed",
90       ],
91     },
92     is_nullable => 1,
93   },
94   "error_message",
95   { data_type => "varchar", is_nullable => 1, size => 100 },
96 );
97
98 =head1 PRIMARY KEY
99
100 =over 4
101
102 =item * L</id>
103
104 =back
105
106 =cut
107
108 __PACKAGE__->set_primary_key("id");
109
110 =head1 RELATIONS
111
112 =head2 club_hold
113
114 Type: belongs_to
115
116 Related object: L<Koha::Schema::Result::ClubHold>
117
118 =cut
119
120 __PACKAGE__->belongs_to(
121   "club_hold",
122   "Koha::Schema::Result::ClubHold",
123   { id => "club_hold_id" },
124   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
125 );
126
127 =head2 hold
128
129 Type: belongs_to
130
131 Related object: L<Koha::Schema::Result::Reserve>
132
133 =cut
134
135 __PACKAGE__->belongs_to(
136   "hold",
137   "Koha::Schema::Result::Reserve",
138   { reserve_id => "hold_id" },
139   {
140     is_deferrable => 1,
141     join_type     => "LEFT",
142     on_delete     => "CASCADE",
143     on_update     => "CASCADE",
144   },
145 );
146
147 =head2 patron
148
149 Type: belongs_to
150
151 Related object: L<Koha::Schema::Result::Borrower>
152
153 =cut
154
155 __PACKAGE__->belongs_to(
156   "patron",
157   "Koha::Schema::Result::Borrower",
158   { borrowernumber => "patron_id" },
159   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
160 );
161
162
163 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-08-04 18:43:05
164 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KjJWzFhPwQk0SZqrHQ4Alw
165
166 sub koha_objects_class {
167     'Koha::Club::Hold::PatronHolds';
168 }
169 sub koha_object_class {
170     'Koha::Club::Hold::PatronHold';
171 }
172
173 1;