Bug 31652: DBIC schema update
[koha.git] / Koha / Schema / Result / SearchField.pm
1 use utf8;
2 package Koha::Schema::Result::SearchField;
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::SearchField
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<search_field>
19
20 =cut
21
22 __PACKAGE__->table("search_field");
23
24 =head1 ACCESSORS
25
26 =head2 id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 name
33
34   data_type: 'varchar'
35   is_nullable: 0
36   size: 255
37
38 the name of the field as it will be stored in the search engine
39
40 =head2 label
41
42   data_type: 'varchar'
43   is_nullable: 0
44   size: 255
45
46 the human readable name of the field, for display
47
48 =head2 type
49
50   data_type: 'enum'
51   extra: {list => ["","string","date","number","boolean","sum","isbn","stdno","year","callnumber","geo_point"]}
52   is_nullable: 0
53
54 what type of data this holds, relevant when storing it in the search engine
55
56 =head2 weight
57
58   data_type: 'decimal'
59   is_nullable: 1
60   size: [5,2]
61
62 =head2 facet_order
63
64   data_type: 'tinyint'
65   is_nullable: 1
66
67 the order place of the field in facet list if faceted
68
69 =head2 staff_client
70
71   data_type: 'tinyint'
72   default_value: 1
73   is_nullable: 0
74
75 =head2 opac
76
77   data_type: 'tinyint'
78   default_value: 1
79   is_nullable: 0
80
81 =head2 mandatory
82
83   data_type: 'tinyint'
84   is_nullable: 1
85
86 if marked this field is not editable or removable
87
88 =cut
89
90 __PACKAGE__->add_columns(
91   "id",
92   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
93   "name",
94   { data_type => "varchar", is_nullable => 0, size => 255 },
95   "label",
96   { data_type => "varchar", is_nullable => 0, size => 255 },
97   "type",
98   {
99     data_type => "enum",
100     extra => {
101       list => [
102         "",
103         "string",
104         "date",
105         "number",
106         "boolean",
107         "sum",
108         "isbn",
109         "stdno",
110         "year",
111         "callnumber",
112         "geo_point",
113       ],
114     },
115     is_nullable => 0,
116   },
117   "weight",
118   { data_type => "decimal", is_nullable => 1, size => [5, 2] },
119   "facet_order",
120   { data_type => "tinyint", is_nullable => 1 },
121   "staff_client",
122   { data_type => "tinyint", default_value => 1, is_nullable => 0 },
123   "opac",
124   { data_type => "tinyint", default_value => 1, is_nullable => 0 },
125   "mandatory",
126   { data_type => "tinyint", is_nullable => 1 },
127 );
128
129 =head1 PRIMARY KEY
130
131 =over 4
132
133 =item * L</id>
134
135 =back
136
137 =cut
138
139 __PACKAGE__->set_primary_key("id");
140
141 =head1 UNIQUE CONSTRAINTS
142
143 =head2 C<name>
144
145 =over 4
146
147 =item * L</name>
148
149 =back
150
151 =cut
152
153 __PACKAGE__->add_unique_constraint("name", ["name"]);
154
155 =head1 RELATIONS
156
157 =head2 search_marc_to_fields
158
159 Type: has_many
160
161 Related object: L<Koha::Schema::Result::SearchMarcToField>
162
163 =cut
164
165 __PACKAGE__->has_many(
166   "search_marc_to_fields",
167   "Koha::Schema::Result::SearchMarcToField",
168   { "foreign.search_field_id" => "self.id" },
169   { cascade_copy => 0, cascade_delete => 0 },
170 );
171
172
173 # Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-04-30 09:10:16
174 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NE6QXq/8skTxjjoK15fYrg
175
176 __PACKAGE__->add_columns(
177     '+mandatory' => { is_boolean => 1 },
178 );
179
180 __PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
181
182 1;