Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / Schema / Result / ImportBatch.pm
1 use utf8;
2 package Koha::Schema::Result::ImportBatch;
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::ImportBatch
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<import_batches>
19
20 =cut
21
22 __PACKAGE__->table("import_batches");
23
24 =head1 ACCESSORS
25
26 =head2 import_batch_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 unique identifier and primary key
33
34 =head2 matcher_id
35
36   data_type: 'integer'
37   is_nullable: 1
38
39 the id of the match rule used (matchpoints.matcher_id)
40
41 =head2 template_id
42
43   data_type: 'integer'
44   is_nullable: 1
45
46 =head2 branchcode
47
48   data_type: 'varchar'
49   is_nullable: 1
50   size: 10
51
52 =head2 num_records
53
54   data_type: 'integer'
55   default_value: 0
56   is_nullable: 0
57
58 number of records in the file
59
60 =head2 num_items
61
62   data_type: 'integer'
63   default_value: 0
64   is_nullable: 0
65
66 number of items in the file
67
68 =head2 upload_timestamp
69
70   data_type: 'timestamp'
71   datetime_undef_if_invalid: 1
72   default_value: current_timestamp
73   is_nullable: 0
74
75 date and time the file was uploaded
76
77 =head2 overlay_action
78
79   data_type: 'enum'
80   default_value: 'create_new'
81   extra: {list => ["replace","create_new","use_template","ignore"]}
82   is_nullable: 0
83
84 how to handle duplicate records
85
86 =head2 nomatch_action
87
88   data_type: 'enum'
89   default_value: 'create_new'
90   extra: {list => ["create_new","ignore"]}
91   is_nullable: 0
92
93 how to handle records where no match is found
94
95 =head2 item_action
96
97   data_type: 'enum'
98   default_value: 'always_add'
99   extra: {list => ["always_add","add_only_for_matches","add_only_for_new","ignore","replace"]}
100   is_nullable: 0
101
102 what to do with item records
103
104 =head2 import_status
105
106   data_type: 'enum'
107   default_value: 'staging'
108   extra: {list => ["staging","staged","importing","imported","reverting","reverted","cleaned"]}
109   is_nullable: 0
110
111 the status of the imported file
112
113 =head2 batch_type
114
115   data_type: 'enum'
116   default_value: 'batch'
117   extra: {list => ["batch","z3950","webservice"]}
118   is_nullable: 0
119
120 where this batch has come from
121
122 =head2 record_type
123
124   data_type: 'enum'
125   default_value: 'biblio'
126   extra: {list => ["biblio","auth","holdings"]}
127   is_nullable: 0
128
129 type of record in the batch
130
131 =head2 file_name
132
133   data_type: 'varchar'
134   is_nullable: 1
135   size: 100
136
137 the name of the file uploaded
138
139 =head2 comments
140
141   data_type: 'longtext'
142   is_nullable: 1
143
144 any comments added when the file was uploaded
145
146 =head2 profile_id
147
148   data_type: 'integer'
149   is_foreign_key: 1
150   is_nullable: 1
151
152 =cut
153
154 __PACKAGE__->add_columns(
155   "import_batch_id",
156   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
157   "matcher_id",
158   { data_type => "integer", is_nullable => 1 },
159   "template_id",
160   { data_type => "integer", is_nullable => 1 },
161   "branchcode",
162   { data_type => "varchar", is_nullable => 1, size => 10 },
163   "num_records",
164   { data_type => "integer", default_value => 0, is_nullable => 0 },
165   "num_items",
166   { data_type => "integer", default_value => 0, is_nullable => 0 },
167   "upload_timestamp",
168   {
169     data_type => "timestamp",
170     datetime_undef_if_invalid => 1,
171     default_value => \"current_timestamp",
172     is_nullable => 0,
173   },
174   "overlay_action",
175   {
176     data_type => "enum",
177     default_value => "create_new",
178     extra => { list => ["replace", "create_new", "use_template", "ignore"] },
179     is_nullable => 0,
180   },
181   "nomatch_action",
182   {
183     data_type => "enum",
184     default_value => "create_new",
185     extra => { list => ["create_new", "ignore"] },
186     is_nullable => 0,
187   },
188   "item_action",
189   {
190     data_type => "enum",
191     default_value => "always_add",
192     extra => {
193       list => [
194         "always_add",
195         "add_only_for_matches",
196         "add_only_for_new",
197         "ignore",
198         "replace",
199       ],
200     },
201     is_nullable => 0,
202   },
203   "import_status",
204   {
205     data_type => "enum",
206     default_value => "staging",
207     extra => {
208       list => [
209         "staging",
210         "staged",
211         "importing",
212         "imported",
213         "reverting",
214         "reverted",
215         "cleaned",
216       ],
217     },
218     is_nullable => 0,
219   },
220   "batch_type",
221   {
222     data_type => "enum",
223     default_value => "batch",
224     extra => { list => ["batch", "z3950", "webservice"] },
225     is_nullable => 0,
226   },
227   "record_type",
228   {
229     data_type => "enum",
230     default_value => "biblio",
231     extra => { list => ["biblio", "auth", "holdings"] },
232     is_nullable => 0,
233   },
234   "file_name",
235   { data_type => "varchar", is_nullable => 1, size => 100 },
236   "comments",
237   { data_type => "longtext", is_nullable => 1 },
238   "profile_id",
239   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
240 );
241
242 =head1 PRIMARY KEY
243
244 =over 4
245
246 =item * L</import_batch_id>
247
248 =back
249
250 =cut
251
252 __PACKAGE__->set_primary_key("import_batch_id");
253
254 =head1 RELATIONS
255
256 =head2 import_records
257
258 Type: has_many
259
260 Related object: L<Koha::Schema::Result::ImportRecord>
261
262 =cut
263
264 __PACKAGE__->has_many(
265   "import_records",
266   "Koha::Schema::Result::ImportRecord",
267   { "foreign.import_batch_id" => "self.import_batch_id" },
268   { cascade_copy => 0, cascade_delete => 0 },
269 );
270
271 =head2 profile
272
273 Type: belongs_to
274
275 Related object: L<Koha::Schema::Result::ImportBatchProfile>
276
277 =cut
278
279 __PACKAGE__->belongs_to(
280   "profile",
281   "Koha::Schema::Result::ImportBatchProfile",
282   { id => "profile_id" },
283   {
284     is_deferrable => 1,
285     join_type     => "LEFT",
286     on_delete     => "SET NULL",
287     on_update     => "SET NULL",
288   },
289 );
290
291
292 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
293 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+/u1tQQzT5ygzGwVgWxxwg
294
295 =head2 koha_object_class
296
297   Koha Object class
298
299 =cut
300
301 sub koha_object_class {
302     'Koha::ImportBatch';
303 }
304
305 =head2 koha_objects_class
306
307   Koha Objects class
308
309 =cut
310
311 sub koha_objects_class {
312     'Koha::ImportBatches';
313 }
314
315 1;