Bug 23816: (follow-up) Define boolean column in shcema
[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"]}
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       ],
90     },
91     is_nullable => 1,
92   },
93   "error_message",
94   { data_type => "varchar", is_nullable => 1, size => 100 },
95 );
96
97 =head1 PRIMARY KEY
98
99 =over 4
100
101 =item * L</id>
102
103 =back
104
105 =cut
106
107 __PACKAGE__->set_primary_key("id");
108
109 =head1 RELATIONS
110
111 =head2 club_hold
112
113 Type: belongs_to
114
115 Related object: L<Koha::Schema::Result::ClubHold>
116
117 =cut
118
119 __PACKAGE__->belongs_to(
120   "club_hold",
121   "Koha::Schema::Result::ClubHold",
122   { id => "club_hold_id" },
123   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
124 );
125
126 =head2 hold
127
128 Type: belongs_to
129
130 Related object: L<Koha::Schema::Result::Reserve>
131
132 =cut
133
134 __PACKAGE__->belongs_to(
135   "hold",
136   "Koha::Schema::Result::Reserve",
137   { reserve_id => "hold_id" },
138   {
139     is_deferrable => 1,
140     join_type     => "LEFT",
141     on_delete     => "CASCADE",
142     on_update     => "CASCADE",
143   },
144 );
145
146 =head2 patron
147
148 Type: belongs_to
149
150 Related object: L<Koha::Schema::Result::Borrower>
151
152 =cut
153
154 __PACKAGE__->belongs_to(
155   "patron",
156   "Koha::Schema::Result::Borrower",
157   { borrowernumber => "patron_id" },
158   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
159 );
160
161
162 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-01 07:08:47
163 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/T626DfqUi7SnXOyieUzYw
164
165 sub koha_objects_class {
166     'Koha::Club::Hold::PatronHolds';
167 }
168 sub koha_object_class {
169     'Koha::Club::Hold::PatronHold';
170 }
171
172 1;