Bug 22428: DBIC schema
[koha.git] / Koha / Schema / Result / MarcModificationTemplateAction.pm
1 use utf8;
2 package Koha::Schema::Result::MarcModificationTemplateAction;
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::MarcModificationTemplateAction
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<marc_modification_template_actions>
19
20 =cut
21
22 __PACKAGE__->table("marc_modification_template_actions");
23
24 =head1 ACCESSORS
25
26 =head2 mmta_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 template_id
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 0
37
38 =head2 ordering
39
40   data_type: 'integer'
41   is_nullable: 0
42
43 =head2 action
44
45   data_type: 'enum'
46   extra: {list => ["delete_field","add_field","update_field","move_field","copy_field","copy_and_replace_field"]}
47   is_nullable: 0
48
49 =head2 field_number
50
51   data_type: 'smallint'
52   default_value: 0
53   is_nullable: 0
54
55 =head2 from_field
56
57   data_type: 'varchar'
58   is_nullable: 0
59   size: 3
60
61 =head2 from_subfield
62
63   data_type: 'varchar'
64   is_nullable: 1
65   size: 1
66
67 =head2 field_value
68
69   data_type: 'text'
70   is_nullable: 1
71
72 =head2 to_field
73
74   data_type: 'varchar'
75   is_nullable: 1
76   size: 3
77
78 =head2 to_subfield
79
80   data_type: 'varchar'
81   is_nullable: 1
82   size: 1
83
84 =head2 to_regex_search
85
86   data_type: 'mediumtext'
87   is_nullable: 1
88
89 =head2 to_regex_replace
90
91   data_type: 'mediumtext'
92   is_nullable: 1
93
94 =head2 to_regex_modifiers
95
96   data_type: 'varchar'
97   default_value: (empty string)
98   is_nullable: 1
99   size: 8
100
101 =head2 conditional
102
103   data_type: 'enum'
104   extra: {list => ["if","unless"]}
105   is_nullable: 1
106
107 =head2 conditional_field
108
109   data_type: 'varchar'
110   is_nullable: 1
111   size: 3
112
113 =head2 conditional_subfield
114
115   data_type: 'varchar'
116   is_nullable: 1
117   size: 1
118
119 =head2 conditional_comparison
120
121   data_type: 'enum'
122   extra: {list => ["exists","not_exists","equals","not_equals"]}
123   is_nullable: 1
124
125 =head2 conditional_value
126
127   data_type: 'mediumtext'
128   is_nullable: 1
129
130 =head2 conditional_regex
131
132   data_type: 'tinyint'
133   default_value: 0
134   is_nullable: 0
135
136 =head2 description
137
138   data_type: 'mediumtext'
139   is_nullable: 1
140
141 =cut
142
143 __PACKAGE__->add_columns(
144   "mmta_id",
145   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
146   "template_id",
147   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
148   "ordering",
149   { data_type => "integer", is_nullable => 0 },
150   "action",
151   {
152     data_type => "enum",
153     extra => {
154       list => [
155         "delete_field",
156         "add_field",
157         "update_field",
158         "move_field",
159         "copy_field",
160         "copy_and_replace_field",
161       ],
162     },
163     is_nullable => 0,
164   },
165   "field_number",
166   { data_type => "smallint", default_value => 0, is_nullable => 0 },
167   "from_field",
168   { data_type => "varchar", is_nullable => 0, size => 3 },
169   "from_subfield",
170   { data_type => "varchar", is_nullable => 1, size => 1 },
171   "field_value",
172   { data_type => "text", is_nullable => 1 },
173   "to_field",
174   { data_type => "varchar", is_nullable => 1, size => 3 },
175   "to_subfield",
176   { data_type => "varchar", is_nullable => 1, size => 1 },
177   "to_regex_search",
178   { data_type => "mediumtext", is_nullable => 1 },
179   "to_regex_replace",
180   { data_type => "mediumtext", is_nullable => 1 },
181   "to_regex_modifiers",
182   { data_type => "varchar", default_value => "", is_nullable => 1, size => 8 },
183   "conditional",
184   {
185     data_type => "enum",
186     extra => { list => ["if", "unless"] },
187     is_nullable => 1,
188   },
189   "conditional_field",
190   { data_type => "varchar", is_nullable => 1, size => 3 },
191   "conditional_subfield",
192   { data_type => "varchar", is_nullable => 1, size => 1 },
193   "conditional_comparison",
194   {
195     data_type => "enum",
196     extra => { list => ["exists", "not_exists", "equals", "not_equals"] },
197     is_nullable => 1,
198   },
199   "conditional_value",
200   { data_type => "mediumtext", is_nullable => 1 },
201   "conditional_regex",
202   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
203   "description",
204   { data_type => "mediumtext", is_nullable => 1 },
205 );
206
207 =head1 PRIMARY KEY
208
209 =over 4
210
211 =item * L</mmta_id>
212
213 =back
214
215 =cut
216
217 __PACKAGE__->set_primary_key("mmta_id");
218
219 =head1 RELATIONS
220
221 =head2 template
222
223 Type: belongs_to
224
225 Related object: L<Koha::Schema::Result::MarcModificationTemplate>
226
227 =cut
228
229 __PACKAGE__->belongs_to(
230   "template",
231   "Koha::Schema::Result::MarcModificationTemplate",
232   { template_id => "template_id" },
233   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
234 );
235
236
237 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-02-24 20:18:23
238 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yDK2nFt+Fj3UuXAij1UwQw
239
240
241 # You can replace this text with custom code or comments, and it will be preserved on regeneration
242 1;