2 package Koha::Schema::Result::ImportBatch;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Koha::Schema::Result::ImportBatch
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<import_batches>
22 __PACKAGE__->table("import_batches");
26 =head2 import_batch_id
32 unique identifier and primary key
39 the id of the match rule used (matchpoints.matcher_id)
58 number of records in the file
66 number of items in the file
68 =head2 upload_timestamp
70 data_type: 'timestamp'
71 datetime_undef_if_invalid: 1
72 default_value: current_timestamp
75 date and time the file was uploaded
80 default_value: 'create_new'
81 extra: {list => ["replace","create_new","use_template","ignore"]}
84 how to handle duplicate records
89 default_value: 'create_new'
90 extra: {list => ["create_new","ignore"]}
93 how to handle records where no match is found
98 default_value: 'always_add'
99 extra: {list => ["always_add","add_only_for_matches","add_only_for_new","ignore","replace"]}
102 what to do with item records
107 default_value: 'staging'
108 extra: {list => ["staging","staged","importing","imported","reverting","reverted","cleaned"]}
111 the status of the imported file
116 default_value: 'batch'
117 extra: {list => ["batch","z3950","webservice"]}
120 where this batch has come from
125 default_value: 'biblio'
126 extra: {list => ["biblio","auth","holdings"]}
129 type of record in the batch
137 the name of the file uploaded
141 data_type: 'longtext'
144 any comments added when the file was uploaded
154 __PACKAGE__->add_columns(
156 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
158 { data_type => "integer", is_nullable => 1 },
160 { data_type => "integer", is_nullable => 1 },
162 { data_type => "varchar", is_nullable => 1, size => 10 },
164 { data_type => "integer", default_value => 0, is_nullable => 0 },
166 { data_type => "integer", default_value => 0, is_nullable => 0 },
169 data_type => "timestamp",
170 datetime_undef_if_invalid => 1,
171 default_value => \"current_timestamp",
177 default_value => "create_new",
178 extra => { list => ["replace", "create_new", "use_template", "ignore"] },
184 default_value => "create_new",
185 extra => { list => ["create_new", "ignore"] },
191 default_value => "always_add",
195 "add_only_for_matches",
206 default_value => "staging",
223 default_value => "batch",
224 extra => { list => ["batch", "z3950", "webservice"] },
230 default_value => "biblio",
231 extra => { list => ["biblio", "auth", "holdings"] },
235 { data_type => "varchar", is_nullable => 1, size => 100 },
237 { data_type => "longtext", is_nullable => 1 },
239 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
246 =item * L</import_batch_id>
252 __PACKAGE__->set_primary_key("import_batch_id");
256 =head2 import_records
260 Related object: L<Koha::Schema::Result::ImportRecord>
264 __PACKAGE__->has_many(
266 "Koha::Schema::Result::ImportRecord",
267 { "foreign.import_batch_id" => "self.import_batch_id" },
268 { cascade_copy => 0, cascade_delete => 0 },
275 Related object: L<Koha::Schema::Result::ImportBatchProfile>
279 __PACKAGE__->belongs_to(
281 "Koha::Schema::Result::ImportBatchProfile",
282 { id => "profile_id" },
286 on_delete => "SET NULL",
287 on_update => "SET NULL",
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
295 =head2 koha_object_class
301 sub koha_object_class {
305 =head2 koha_objects_class
311 sub koha_objects_class {
312 'Koha::ImportBatches';