Bug 23816: (follow-up) Define boolean column in shcema
[koha.git] / Koha / Schema / Result / Category.pm
1 use utf8;
2 package Koha::Schema::Result::Category;
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::Category
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<categories>
19
20 =cut
21
22 __PACKAGE__->table("categories");
23
24 =head1 ACCESSORS
25
26 =head2 categorycode
27
28   data_type: 'varchar'
29   default_value: (empty string)
30   is_nullable: 0
31   size: 10
32
33 =head2 description
34
35   data_type: 'longtext'
36   is_nullable: 1
37
38 =head2 enrolmentperiod
39
40   data_type: 'smallint'
41   is_nullable: 1
42
43 =head2 enrolmentperioddate
44
45   data_type: 'date'
46   datetime_undef_if_invalid: 1
47   is_nullable: 1
48
49 =head2 upperagelimit
50
51   data_type: 'smallint'
52   is_nullable: 1
53
54 =head2 dateofbirthrequired
55
56   data_type: 'tinyint'
57   is_nullable: 1
58
59 =head2 finetype
60
61   data_type: 'varchar'
62   is_nullable: 1
63   size: 30
64
65 =head2 bulk
66
67   data_type: 'tinyint'
68   is_nullable: 1
69
70 =head2 enrolmentfee
71
72   data_type: 'decimal'
73   is_nullable: 1
74   size: [28,6]
75
76 =head2 overduenoticerequired
77
78   data_type: 'tinyint'
79   is_nullable: 1
80
81 =head2 issuelimit
82
83   data_type: 'smallint'
84   is_nullable: 1
85
86 =head2 reservefee
87
88   data_type: 'decimal'
89   is_nullable: 1
90   size: [28,6]
91
92 =head2 hidelostitems
93
94   data_type: 'tinyint'
95   default_value: 0
96   is_nullable: 0
97
98 =head2 category_type
99
100   data_type: 'varchar'
101   default_value: 'A'
102   is_nullable: 0
103   size: 1
104
105 =head2 BlockExpiredPatronOpacActions
106
107   accessor: 'block_expired_patron_opac_actions'
108   data_type: 'tinyint'
109   default_value: -1
110   is_nullable: 0
111
112 =head2 default_privacy
113
114   data_type: 'enum'
115   default_value: 'default'
116   extra: {list => ["default","never","forever"]}
117   is_nullable: 0
118
119 =head2 checkprevcheckout
120
121   data_type: 'varchar'
122   default_value: 'inherit'
123   is_nullable: 0
124   size: 7
125
126 =head2 reset_password
127
128   data_type: 'tinyint'
129   is_nullable: 1
130
131 =head2 change_password
132
133   data_type: 'tinyint'
134   is_nullable: 1
135
136 =head2 exclude_from_local_holds_priority
137
138   data_type: 'tinyint'
139   is_nullable: 1
140
141 =head2 min_password_length
142
143   data_type: 'smallint'
144   is_nullable: 1
145
146 =head2 require_strong_password
147
148   data_type: 'tinyint'
149   is_nullable: 1
150
151 =cut
152
153 __PACKAGE__->add_columns(
154   "categorycode",
155   { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
156   "description",
157   { data_type => "longtext", is_nullable => 1 },
158   "enrolmentperiod",
159   { data_type => "smallint", is_nullable => 1 },
160   "enrolmentperioddate",
161   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
162   "upperagelimit",
163   { data_type => "smallint", is_nullable => 1 },
164   "dateofbirthrequired",
165   { data_type => "tinyint", is_nullable => 1 },
166   "finetype",
167   { data_type => "varchar", is_nullable => 1, size => 30 },
168   "bulk",
169   { data_type => "tinyint", is_nullable => 1 },
170   "enrolmentfee",
171   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
172   "overduenoticerequired",
173   { data_type => "tinyint", is_nullable => 1 },
174   "issuelimit",
175   { data_type => "smallint", is_nullable => 1 },
176   "reservefee",
177   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
178   "hidelostitems",
179   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
180   "category_type",
181   { data_type => "varchar", default_value => "A", is_nullable => 0, size => 1 },
182   "BlockExpiredPatronOpacActions",
183   {
184     accessor      => "block_expired_patron_opac_actions",
185     data_type     => "tinyint",
186     default_value => -1,
187     is_nullable   => 0,
188   },
189   "default_privacy",
190   {
191     data_type => "enum",
192     default_value => "default",
193     extra => { list => ["default", "never", "forever"] },
194     is_nullable => 0,
195   },
196   "checkprevcheckout",
197   {
198     data_type => "varchar",
199     default_value => "inherit",
200     is_nullable => 0,
201     size => 7,
202   },
203   "reset_password",
204   { data_type => "tinyint", is_nullable => 1 },
205   "change_password",
206   { data_type => "tinyint", is_nullable => 1 },
207   "exclude_from_local_holds_priority",
208   { data_type => "tinyint", is_nullable => 1 },
209   "min_password_length",
210   { data_type => "smallint", is_nullable => 1 },
211   "require_strong_password",
212   { data_type => "tinyint", is_nullable => 1 },
213 );
214
215 =head1 PRIMARY KEY
216
217 =over 4
218
219 =item * L</categorycode>
220
221 =back
222
223 =cut
224
225 __PACKAGE__->set_primary_key("categorycode");
226
227 =head1 RELATIONS
228
229 =head2 borrower_message_preferences
230
231 Type: has_many
232
233 Related object: L<Koha::Schema::Result::BorrowerMessagePreference>
234
235 =cut
236
237 __PACKAGE__->has_many(
238   "borrower_message_preferences",
239   "Koha::Schema::Result::BorrowerMessagePreference",
240   { "foreign.categorycode" => "self.categorycode" },
241   { cascade_copy => 0, cascade_delete => 0 },
242 );
243
244 =head2 borrowers
245
246 Type: has_many
247
248 Related object: L<Koha::Schema::Result::Borrower>
249
250 =cut
251
252 __PACKAGE__->has_many(
253   "borrowers",
254   "Koha::Schema::Result::Borrower",
255   { "foreign.categorycode" => "self.categorycode" },
256   { cascade_copy => 0, cascade_delete => 0 },
257 );
258
259 =head2 categories_branches
260
261 Type: has_many
262
263 Related object: L<Koha::Schema::Result::CategoriesBranch>
264
265 =cut
266
267 __PACKAGE__->has_many(
268   "categories_branches",
269   "Koha::Schema::Result::CategoriesBranch",
270   { "foreign.categorycode" => "self.categorycode" },
271   { cascade_copy => 0, cascade_delete => 0 },
272 );
273
274 =head2 circulation_rules
275
276 Type: has_many
277
278 Related object: L<Koha::Schema::Result::CirculationRule>
279
280 =cut
281
282 __PACKAGE__->has_many(
283   "circulation_rules",
284   "Koha::Schema::Result::CirculationRule",
285   { "foreign.categorycode" => "self.categorycode" },
286   { cascade_copy => 0, cascade_delete => 0 },
287 );
288
289 =head2 pseudonymized_transactions
290
291 Type: has_many
292
293 Related object: L<Koha::Schema::Result::PseudonymizedTransaction>
294
295 =cut
296
297 __PACKAGE__->has_many(
298   "pseudonymized_transactions",
299   "Koha::Schema::Result::PseudonymizedTransaction",
300   { "foreign.categorycode" => "self.categorycode" },
301   { cascade_copy => 0, cascade_delete => 0 },
302 );
303
304
305 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-09-02 12:50:50
306 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JOzFLxLwouaTl5dQJrOdZA
307
308 __PACKAGE__->add_columns(
309     '+exclude_from_local_holds_priority' => { is_boolean => 1 },
310 );
311
312 sub koha_object_class {
313     'Koha::Patron::Category';
314 }
315 sub koha_objects_class {
316     'Koha::Patron::Categories';
317 }
318
319 __PACKAGE__->add_columns(
320     '+require_strong_password' => { is_boolean => 1 }
321 );
322
323 1;