Bug 12478: Manually add the many_to_many relationships
[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"]}
52   is_nullable: 0
53
54 what type of data this holds, relevant when storing it in the search engine
55
56 =cut
57
58 __PACKAGE__->add_columns(
59   "id",
60   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
61   "name",
62   { data_type => "varchar", is_nullable => 0, size => 255 },
63   "label",
64   { data_type => "varchar", is_nullable => 0, size => 255 },
65   "type",
66   {
67     data_type => "enum",
68     extra => { list => ["string", "date", "number", "boolean", "sum"] },
69     is_nullable => 0,
70   },
71 );
72
73 =head1 PRIMARY KEY
74
75 =over 4
76
77 =item * L</id>
78
79 =back
80
81 =cut
82
83 __PACKAGE__->set_primary_key("id");
84
85 =head1 UNIQUE CONSTRAINTS
86
87 =head2 C<name>
88
89 =over 4
90
91 =item * L</name>
92
93 =back
94
95 =cut
96
97 __PACKAGE__->add_unique_constraint("name", ["name"]);
98
99 =head1 RELATIONS
100
101 =head2 search_marc_to_fields
102
103 Type: has_many
104
105 Related object: L<Koha::Schema::Result::SearchMarcToField>
106
107 =cut
108
109 __PACKAGE__->has_many(
110   "search_marc_to_fields",
111   "Koha::Schema::Result::SearchMarcToField",
112   { "foreign.search_field_id" => "self.id" },
113   { cascade_copy => 0, cascade_delete => 0 },
114 );
115
116
117 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-12 16:41:47
118 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4MJO9216VF37w7PlWCcBKg
119
120 __PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
121
122 1;