Bug 21395: Fix creation of PO file
[koha.git] / Koha / Schema / Result / ImportRecord.pm
blob8499e4bb868146327cf3d9194d314c72a7867e36
1 use utf8;
2 package Koha::Schema::Result::ImportRecord;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::ImportRecord
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<import_records>
20 =cut
22 __PACKAGE__->table("import_records");
24 =head1 ACCESSORS
26 =head2 import_record_id
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 import_batch_id
34 data_type: 'integer'
35 is_foreign_key: 1
36 is_nullable: 0
38 =head2 branchcode
40 data_type: 'varchar'
41 is_nullable: 1
42 size: 10
44 =head2 record_sequence
46 data_type: 'integer'
47 default_value: 0
48 is_nullable: 0
50 =head2 upload_timestamp
52 data_type: 'timestamp'
53 datetime_undef_if_invalid: 1
54 default_value: current_timestamp
55 is_nullable: 0
57 =head2 import_date
59 data_type: 'date'
60 datetime_undef_if_invalid: 1
61 is_nullable: 1
63 =head2 marc
65 data_type: 'longblob'
66 is_nullable: 0
68 =head2 marcxml
70 data_type: 'longtext'
71 is_nullable: 0
73 =head2 marcxml_old
75 data_type: 'longtext'
76 is_nullable: 0
78 =head2 record_type
80 data_type: 'enum'
81 default_value: 'biblio'
82 extra: {list => ["biblio","auth","holdings"]}
83 is_nullable: 0
85 =head2 overlay_status
87 data_type: 'enum'
88 default_value: 'no_match'
89 extra: {list => ["no_match","auto_match","manual_match","match_applied"]}
90 is_nullable: 0
92 =head2 status
94 data_type: 'enum'
95 default_value: 'staged'
96 extra: {list => ["error","staged","imported","reverted","items_reverted","ignored"]}
97 is_nullable: 0
99 =head2 import_error
101 data_type: 'longtext'
102 is_nullable: 1
104 =head2 encoding
106 data_type: 'varchar'
107 default_value: (empty string)
108 is_nullable: 0
109 size: 40
111 =cut
113 __PACKAGE__->add_columns(
114 "import_record_id",
115 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
116 "import_batch_id",
117 { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
118 "branchcode",
119 { data_type => "varchar", is_nullable => 1, size => 10 },
120 "record_sequence",
121 { data_type => "integer", default_value => 0, is_nullable => 0 },
122 "upload_timestamp",
124 data_type => "timestamp",
125 datetime_undef_if_invalid => 1,
126 default_value => \"current_timestamp",
127 is_nullable => 0,
129 "import_date",
130 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
131 "marc",
132 { data_type => "longblob", is_nullable => 0 },
133 "marcxml",
134 { data_type => "longtext", is_nullable => 0 },
135 "marcxml_old",
136 { data_type => "longtext", is_nullable => 0 },
137 "record_type",
139 data_type => "enum",
140 default_value => "biblio",
141 extra => { list => ["biblio", "auth", "holdings"] },
142 is_nullable => 0,
144 "overlay_status",
146 data_type => "enum",
147 default_value => "no_match",
148 extra => {
149 list => ["no_match", "auto_match", "manual_match", "match_applied"],
151 is_nullable => 0,
153 "status",
155 data_type => "enum",
156 default_value => "staged",
157 extra => {
158 list => [
159 "error",
160 "staged",
161 "imported",
162 "reverted",
163 "items_reverted",
164 "ignored",
167 is_nullable => 0,
169 "import_error",
170 { data_type => "longtext", is_nullable => 1 },
171 "encoding",
172 { data_type => "varchar", default_value => "", is_nullable => 0, size => 40 },
175 =head1 PRIMARY KEY
177 =over 4
179 =item * L</import_record_id>
181 =back
183 =cut
185 __PACKAGE__->set_primary_key("import_record_id");
187 =head1 RELATIONS
189 =head2 import_auths
191 Type: has_many
193 Related object: L<Koha::Schema::Result::ImportAuth>
195 =cut
197 __PACKAGE__->has_many(
198 "import_auths",
199 "Koha::Schema::Result::ImportAuth",
200 { "foreign.import_record_id" => "self.import_record_id" },
201 { cascade_copy => 0, cascade_delete => 0 },
204 =head2 import_batch
206 Type: belongs_to
208 Related object: L<Koha::Schema::Result::ImportBatch>
210 =cut
212 __PACKAGE__->belongs_to(
213 "import_batch",
214 "Koha::Schema::Result::ImportBatch",
215 { import_batch_id => "import_batch_id" },
216 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
219 =head2 import_biblios
221 Type: has_many
223 Related object: L<Koha::Schema::Result::ImportBiblio>
225 =cut
227 __PACKAGE__->has_many(
228 "import_biblios",
229 "Koha::Schema::Result::ImportBiblio",
230 { "foreign.import_record_id" => "self.import_record_id" },
231 { cascade_copy => 0, cascade_delete => 0 },
234 =head2 import_items
236 Type: has_many
238 Related object: L<Koha::Schema::Result::ImportItem>
240 =cut
242 __PACKAGE__->has_many(
243 "import_items",
244 "Koha::Schema::Result::ImportItem",
245 { "foreign.import_record_id" => "self.import_record_id" },
246 { cascade_copy => 0, cascade_delete => 0 },
249 =head2 import_record_matches
251 Type: has_many
253 Related object: L<Koha::Schema::Result::ImportRecordMatch>
255 =cut
257 __PACKAGE__->has_many(
258 "import_record_matches",
259 "Koha::Schema::Result::ImportRecordMatch",
260 { "foreign.import_record_id" => "self.import_record_id" },
261 { cascade_copy => 0, cascade_delete => 0 },
265 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-18 10:50:48
266 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bqIAQzhgioWtBWU8zFdtjw
269 # You can replace this text with custom content, and it will be preserved on regeneration