]> git.koha-community.org Git - koha.git/blob - Koha/Schema/Result/SearchField.pm
Bug 12446: (QA follow-up) Minor kohastructure.sql fix
[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"]}
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       ],
112     },
113     is_nullable => 0,
114   },
115   "weight",
116   { data_type => "decimal", is_nullable => 1, size => [5, 2] },
117   "facet_order",
118   { data_type => "tinyint", is_nullable => 1 },
119   "staff_client",
120   { data_type => "tinyint", default_value => 1, is_nullable => 0 },
121   "opac",
122   { data_type => "tinyint", default_value => 1, is_nullable => 0 },
123   "mandatory",
124   { data_type => "tinyint", is_nullable => 1 },
125 );
126
127 =head1 PRIMARY KEY
128
129 =over 4
130
131 =item * L</id>
132
133 =back
134
135 =cut
136
137 __PACKAGE__->set_primary_key("id");
138
139 =head1 UNIQUE CONSTRAINTS
140
141 =head2 C<name>
142
143 =over 4
144
145 =item * L</name>
146
147 =back
148
149 =cut
150
151 __PACKAGE__->add_unique_constraint("name", ["name"]);
152
153 =head1 RELATIONS
154
155 =head2 search_marc_to_fields
156
157 Type: has_many
158
159 Related object: L<Koha::Schema::Result::SearchMarcToField>
160
161 =cut
162
163 __PACKAGE__->has_many(
164   "search_marc_to_fields",
165   "Koha::Schema::Result::SearchMarcToField",
166   { "foreign.search_field_id" => "self.id" },
167   { cascade_copy => 0, cascade_delete => 0 },
168 );
169
170
171 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-04-08 09:37:38
172 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iWmUtCXEzX6vilFP9jdojA
173
174 __PACKAGE__->add_columns(
175     '+mandatory' => { is_boolean => 1 },
176 );
177
178 __PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
179
180 1;