Bug 18235: DBRev 18.12.00.032
[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 =cut
70
71 __PACKAGE__->add_columns(
72   "id",
73   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
74   "name",
75   { data_type => "varchar", is_nullable => 0, size => 255 },
76   "label",
77   { data_type => "varchar", is_nullable => 0, size => 255 },
78   "type",
79   {
80     data_type => "enum",
81     extra => {
82       list => ["", "string", "date", "number", "boolean", "sum", "isbn", "stdno"],
83     },
84     is_nullable => 0,
85   },
86   "weight",
87   { data_type => "decimal", is_nullable => 1, size => [5, 2] },
88   "facet_order",
89   { data_type => "tinyint", is_nullable => 1 },
90 );
91
92 =head1 PRIMARY KEY
93
94 =over 4
95
96 =item * L</id>
97
98 =back
99
100 =cut
101
102 __PACKAGE__->set_primary_key("id");
103
104 =head1 UNIQUE CONSTRAINTS
105
106 =head2 C<name>
107
108 =over 4
109
110 =item * L</name>
111
112 =back
113
114 =cut
115
116 __PACKAGE__->add_unique_constraint("name", ["name"]);
117
118 =head1 RELATIONS
119
120 =head2 search_marc_to_fields
121
122 Type: has_many
123
124 Related object: L<Koha::Schema::Result::SearchMarcToField>
125
126 =cut
127
128 __PACKAGE__->has_many(
129   "search_marc_to_fields",
130   "Koha::Schema::Result::SearchMarcToField",
131   { "foreign.search_field_id" => "self.id" },
132   { cascade_copy => 0, cascade_delete => 0 },
133 );
134
135
136 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-28 15:31:40
137 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4Hc7O2fMCses1Bgfmk6Anw
138
139 __PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
140
141 1;