Bug 24151: DBIC changes
[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"]}
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 =cut
82
83 __PACKAGE__->add_columns(
84   "id",
85   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
86   "name",
87   { data_type => "varchar", is_nullable => 0, size => 255 },
88   "label",
89   { data_type => "varchar", is_nullable => 0, size => 255 },
90   "type",
91   {
92     data_type => "enum",
93     extra => {
94       list => ["", "string", "date", "number", "boolean", "sum", "isbn", "stdno"],
95     },
96     is_nullable => 0,
97   },
98   "weight",
99   { data_type => "decimal", is_nullable => 1, size => [5, 2] },
100   "facet_order",
101   { data_type => "tinyint", is_nullable => 1 },
102   "staff_client",
103   { data_type => "tinyint", default_value => 1, is_nullable => 0 },
104   "opac",
105   { data_type => "tinyint", default_value => 1, is_nullable => 0 },
106 );
107
108 =head1 PRIMARY KEY
109
110 =over 4
111
112 =item * L</id>
113
114 =back
115
116 =cut
117
118 __PACKAGE__->set_primary_key("id");
119
120 =head1 UNIQUE CONSTRAINTS
121
122 =head2 C<name>
123
124 =over 4
125
126 =item * L</name>
127
128 =back
129
130 =cut
131
132 __PACKAGE__->add_unique_constraint("name", ["name"]);
133
134 =head1 RELATIONS
135
136 =head2 search_marc_to_fields
137
138 Type: has_many
139
140 Related object: L<Koha::Schema::Result::SearchMarcToField>
141
142 =cut
143
144 __PACKAGE__->has_many(
145   "search_marc_to_fields",
146   "Koha::Schema::Result::SearchMarcToField",
147   { "foreign.search_field_id" => "self.id" },
148   { cascade_copy => 0, cascade_delete => 0 },
149 );
150
151
152 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-02 12:47:22
153 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EbUa4eprgxeUkoOUiXO/Cg
154
155 __PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
156
157 1;