Bug 12478: allow more granular sorting configuration
[koha.git] / Koha / Schema / Result / SearchMarcMap.pm
1 use utf8;
2 package Koha::Schema::Result::SearchMarcMap;
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::SearchMarcMap
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<search_marc_map>
19
20 =cut
21
22 __PACKAGE__->table("search_marc_map");
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 index_name
33
34   data_type: 'enum'
35   extra: {list => ["biblios","authorities"]}
36   is_nullable: 0
37
38 what storage index this map is for
39
40 =head2 marc_type
41
42   data_type: 'enum'
43   extra: {list => ["marc21","unimarc","normarc"]}
44   is_nullable: 0
45
46 what MARC type this map is for
47
48 =head2 marc_field
49
50   data_type: 'varchar'
51   is_nullable: 0
52   size: 255
53
54 the MARC specifier for this field
55
56 =head2 facet
57
58   data_type: 'tinyint'
59   default_value: 0
60   is_nullable: 1
61
62 true if a facet field should be generated for this
63
64 =head2 suggestible
65
66   data_type: 'tinyint'
67   default_value: 0
68   is_nullable: 1
69
70 true if this field can be used to generate suggestions for browse
71
72 =head2 sort
73
74   data_type: 'tinyint'
75   is_nullable: 1
76
77 true/false creates special sort handling, null doesn't
78
79 =cut
80
81 __PACKAGE__->add_columns(
82   "id",
83   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
84   "index_name",
85   {
86     data_type => "enum",
87     extra => { list => ["biblios", "authorities"] },
88     is_nullable => 0,
89   },
90   "marc_type",
91   {
92     data_type => "enum",
93     extra => { list => ["marc21", "unimarc", "normarc"] },
94     is_nullable => 0,
95   },
96   "marc_field",
97   { data_type => "varchar", is_nullable => 0, size => 255 },
98   "facet",
99   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
100   "suggestible",
101   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
102   "sort",
103   { data_type => "tinyint", is_nullable => 1 },
104 );
105
106 =head1 PRIMARY KEY
107
108 =over 4
109
110 =item * L</id>
111
112 =back
113
114 =cut
115
116 __PACKAGE__->set_primary_key("id");
117
118 =head1 UNIQUE CONSTRAINTS
119
120 =head2 C<index_name_2>
121
122 =over 4
123
124 =item * L</index_name>
125
126 =item * L</marc_type>
127
128 =item * L</marc_field>
129
130 =back
131
132 =cut
133
134 __PACKAGE__->add_unique_constraint("index_name_2", ["index_name", "marc_type", "marc_field"]);
135
136 =head1 RELATIONS
137
138 =head2 search_marc_to_fields
139
140 Type: has_many
141
142 Related object: L<Koha::Schema::Result::SearchMarcToField>
143
144 =cut
145
146 __PACKAGE__->has_many(
147   "search_marc_to_fields",
148   "Koha::Schema::Result::SearchMarcToField",
149   { "foreign.search_marc_map_id" => "self.id" },
150   { cascade_copy => 0, cascade_delete => 0 },
151 );
152
153 =head2 search_fields
154
155 Type: many_to_many
156
157 Composing rels: L</search_marc_to_fields> -> search_field
158
159 =cut
160
161 __PACKAGE__->many_to_many("search_fields", "search_marc_to_fields", "search_field");
162
163
164 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-01 16:56:47
165 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Vo1uboO+iKCunqfpetswDg
166
167
168 # You can replace this text with custom code or comments, and it will be preserved on regeneration
169 1;