Bug 22532: DBRev 18.12.00.059
[koha-equinox.git] / Koha / Schema / Result / ImportRecord.pm
1 use utf8;
2 package Koha::Schema::Result::ImportRecord;
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::ImportRecord
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<import_records>
19
20 =cut
21
22 __PACKAGE__->table("import_records");
23
24 =head1 ACCESSORS
25
26 =head2 import_record_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 import_batch_id
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 0
37
38 =head2 branchcode
39
40   data_type: 'varchar'
41   is_nullable: 1
42   size: 10
43
44 =head2 record_sequence
45
46   data_type: 'integer'
47   default_value: 0
48   is_nullable: 0
49
50 =head2 upload_timestamp
51
52   data_type: 'timestamp'
53   datetime_undef_if_invalid: 1
54   default_value: current_timestamp
55   is_nullable: 0
56
57 =head2 import_date
58
59   data_type: 'date'
60   datetime_undef_if_invalid: 1
61   is_nullable: 1
62
63 =head2 marc
64
65   data_type: 'longblob'
66   is_nullable: 0
67
68 =head2 marcxml
69
70   data_type: 'longtext'
71   is_nullable: 0
72
73 =head2 marcxml_old
74
75   data_type: 'longtext'
76   is_nullable: 0
77
78 =head2 record_type
79
80   data_type: 'enum'
81   default_value: 'biblio'
82   extra: {list => ["biblio","auth","holdings"]}
83   is_nullable: 0
84
85 =head2 overlay_status
86
87   data_type: 'enum'
88   default_value: 'no_match'
89   extra: {list => ["no_match","auto_match","manual_match","match_applied"]}
90   is_nullable: 0
91
92 =head2 status
93
94   data_type: 'enum'
95   default_value: 'staged'
96   extra: {list => ["error","staged","imported","reverted","items_reverted","ignored"]}
97   is_nullable: 0
98
99 =head2 import_error
100
101   data_type: 'longtext'
102   is_nullable: 1
103
104 =head2 encoding
105
106   data_type: 'varchar'
107   default_value: (empty string)
108   is_nullable: 0
109   size: 40
110
111 =cut
112
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",
123   {
124     data_type => "timestamp",
125     datetime_undef_if_invalid => 1,
126     default_value => \"current_timestamp",
127     is_nullable => 0,
128   },
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",
138   {
139     data_type => "enum",
140     default_value => "biblio",
141     extra => { list => ["biblio", "auth", "holdings"] },
142     is_nullable => 0,
143   },
144   "overlay_status",
145   {
146     data_type => "enum",
147     default_value => "no_match",
148     extra => {
149       list => ["no_match", "auto_match", "manual_match", "match_applied"],
150     },
151     is_nullable => 0,
152   },
153   "status",
154   {
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",
165       ],
166     },
167     is_nullable => 0,
168   },
169   "import_error",
170   { data_type => "longtext", is_nullable => 1 },
171   "encoding",
172   { data_type => "varchar", default_value => "", is_nullable => 0, size => 40 },
173 );
174
175 =head1 PRIMARY KEY
176
177 =over 4
178
179 =item * L</import_record_id>
180
181 =back
182
183 =cut
184
185 __PACKAGE__->set_primary_key("import_record_id");
186
187 =head1 RELATIONS
188
189 =head2 import_auths
190
191 Type: has_many
192
193 Related object: L<Koha::Schema::Result::ImportAuth>
194
195 =cut
196
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 },
202 );
203
204 =head2 import_batch
205
206 Type: belongs_to
207
208 Related object: L<Koha::Schema::Result::ImportBatch>
209
210 =cut
211
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" },
217 );
218
219 =head2 import_biblios
220
221 Type: has_many
222
223 Related object: L<Koha::Schema::Result::ImportBiblio>
224
225 =cut
226
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 },
232 );
233
234 =head2 import_items
235
236 Type: has_many
237
238 Related object: L<Koha::Schema::Result::ImportItem>
239
240 =cut
241
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 },
247 );
248
249 =head2 import_record_matches
250
251 Type: has_many
252
253 Related object: L<Koha::Schema::Result::ImportRecordMatch>
254
255 =cut
256
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 },
262 );
263
264
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
267
268
269 # You can replace this text with custom content, and it will be preserved on regeneration
270 1;