Bug 36755: DBIC schema update
[koha.git] / Koha / Schema / Result / BorrowerAttributeType.pm
1 use utf8;
2 package Koha::Schema::Result::BorrowerAttributeType;
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::BorrowerAttributeType
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<borrower_attribute_types>
19
20 =cut
21
22 __PACKAGE__->table("borrower_attribute_types");
23
24 =head1 ACCESSORS
25
26 =head2 code
27
28   data_type: 'varchar'
29   is_nullable: 0
30   size: 64
31
32 unique key used to identify each custom field
33
34 =head2 description
35
36   data_type: 'varchar'
37   is_nullable: 0
38   size: 255
39
40 description for each custom field
41
42 =head2 repeatable
43
44   data_type: 'tinyint'
45   default_value: 0
46   is_nullable: 0
47
48 defines whether one patron/borrower can have multiple values for this custom field  (1 for yes, 0 for no)
49
50 =head2 unique_id
51
52   data_type: 'tinyint'
53   default_value: 0
54   is_nullable: 0
55
56 defines if this value needs to be unique (1 for yes, 0 for no)
57
58 =head2 is_date
59
60   data_type: 'tinyint'
61   default_value: 0
62   is_nullable: 0
63
64 defines if this field is displayed as a date
65
66 =head2 opac_display
67
68   data_type: 'tinyint'
69   default_value: 0
70   is_nullable: 0
71
72 defines if this field is visible to patrons on their account in the OPAC (1 for yes, 0 for no)
73
74 =head2 opac_editable
75
76   data_type: 'tinyint'
77   default_value: 0
78   is_nullable: 0
79
80 defines if this field is editable by patrons on their account in the OPAC (1 for yes, 0 for no)
81
82 =head2 staff_searchable
83
84   data_type: 'tinyint'
85   default_value: 0
86   is_nullable: 0
87
88 defines if this field is searchable via the patron search in the staff interface (1 for yes, 0 for no)
89
90 =head2 searched_by_default
91
92   data_type: 'tinyint'
93   default_value: 0
94   is_nullable: 0
95
96 defines if this field is included in "Standard" patron searches in the staff interface (1 for yes, 0 for no)
97
98 =head2 authorised_value_category
99
100   data_type: 'varchar'
101   is_nullable: 1
102   size: 32
103
104 foreign key from authorised_values that links this custom field to an authorized value category
105
106 =head2 display_checkout
107
108   data_type: 'tinyint'
109   default_value: 0
110   is_nullable: 0
111
112 defines if this field displays in checkout screens
113
114 =head2 category_code
115
116   data_type: 'varchar'
117   is_foreign_key: 1
118   is_nullable: 1
119   size: 10
120
121 defines a category for an attribute_type
122
123 =head2 class
124
125   data_type: 'varchar'
126   default_value: (empty string)
127   is_nullable: 0
128   size: 255
129
130 defines a class for an attribute_type
131
132 =head2 keep_for_pseudonymization
133
134   data_type: 'tinyint'
135   default_value: 0
136   is_nullable: 0
137
138 defines if this field is copied to anonymized_borrower_attributes (1 for yes, 0 for no)
139
140 =head2 mandatory
141
142   data_type: 'tinyint'
143   default_value: 0
144   is_nullable: 0
145
146 defines if the attribute is mandatory or not
147
148 =cut
149
150 __PACKAGE__->add_columns(
151   "code",
152   { data_type => "varchar", is_nullable => 0, size => 64 },
153   "description",
154   { data_type => "varchar", is_nullable => 0, size => 255 },
155   "repeatable",
156   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
157   "unique_id",
158   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
159   "is_date",
160   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
161   "opac_display",
162   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
163   "opac_editable",
164   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
165   "staff_searchable",
166   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
167   "searched_by_default",
168   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
169   "authorised_value_category",
170   { data_type => "varchar", is_nullable => 1, size => 32 },
171   "display_checkout",
172   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
173   "category_code",
174   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
175   "class",
176   { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 },
177   "keep_for_pseudonymization",
178   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
179   "mandatory",
180   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
181 );
182
183 =head1 PRIMARY KEY
184
185 =over 4
186
187 =item * L</code>
188
189 =back
190
191 =cut
192
193 __PACKAGE__->set_primary_key("code");
194
195 =head1 RELATIONS
196
197 =head2 borrower_attribute_types_branches
198
199 Type: has_many
200
201 Related object: L<Koha::Schema::Result::BorrowerAttributeTypesBranch>
202
203 =cut
204
205 __PACKAGE__->has_many(
206   "borrower_attribute_types_branches",
207   "Koha::Schema::Result::BorrowerAttributeTypesBranch",
208   { "foreign.bat_code" => "self.code" },
209   { cascade_copy => 0, cascade_delete => 0 },
210 );
211
212 =head2 borrower_attributes
213
214 Type: has_many
215
216 Related object: L<Koha::Schema::Result::BorrowerAttribute>
217
218 =cut
219
220 __PACKAGE__->has_many(
221   "borrower_attributes",
222   "Koha::Schema::Result::BorrowerAttribute",
223   { "foreign.code" => "self.code" },
224   { cascade_copy => 0, cascade_delete => 0 },
225 );
226
227 =head2 category_code
228
229 Type: belongs_to
230
231 Related object: L<Koha::Schema::Result::Category>
232
233 =cut
234
235 __PACKAGE__->belongs_to(
236   "category_code",
237   "Koha::Schema::Result::Category",
238   { categorycode => "category_code" },
239   {
240     is_deferrable => 1,
241     join_type     => "LEFT",
242     on_delete     => "RESTRICT",
243     on_update     => "RESTRICT",
244   },
245 );
246
247 =head2 pseudonymized_borrower_attributes
248
249 Type: has_many
250
251 Related object: L<Koha::Schema::Result::PseudonymizedBorrowerAttribute>
252
253 =cut
254
255 __PACKAGE__->has_many(
256   "pseudonymized_borrower_attributes",
257   "Koha::Schema::Result::PseudonymizedBorrowerAttribute",
258   { "foreign.code" => "self.code" },
259   { cascade_copy => 0, cascade_delete => 0 },
260 );
261
262
263 # Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-10 14:00:56
264 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZmiiXHqRGV2SDb4IgSPvJQ
265
266 __PACKAGE__->add_columns(
267     '+keep_for_pseudonymization' => { is_boolean => 1 },
268     '+mandatory'                 => { is_boolean => 1 },
269     '+searched_by_default'       => { is_boolean => 1 },
270     '+staff_searchable'          => { is_boolean => 1 },
271 );
272
273 __PACKAGE__->add_columns(
274     '+is_date' => { is_boolean => 1 },
275 );
276
277 sub koha_object_class {
278     'Koha::Patron::Attribute::Type';
279 }
280 sub koha_objects_class {
281     'Koha::Patron::Attribute::Types';
282 }
283
284 1;