]> git.koha-community.org Git - koha.git/blob - Koha/Schema/Result/SearchField.pm
Bug 14899: DB 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: 1
44   size: 255
45
46 =head2 type
47
48   data_type: 'enum'
49   extra: {list => ["string","date","number","boolean","sum"]}
50   is_nullable: 0
51
52 what type of data this holds, relevant when storing it in the search engine
53
54 =cut
55
56 __PACKAGE__->add_columns(
57   "id",
58   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
59   "name",
60   { data_type => "varchar", is_nullable => 0, size => 255 },
61   "label",
62   { data_type => "varchar", is_nullable => 1, size => 255 },
63   "type",
64   {
65     data_type => "enum",
66     extra => { list => ["string", "date", "number", "boolean", "sum"] },
67     is_nullable => 0,
68   },
69 );
70
71 =head1 PRIMARY KEY
72
73 =over 4
74
75 =item * L</id>
76
77 =back
78
79 =cut
80
81 __PACKAGE__->set_primary_key("id");
82
83 =head1 UNIQUE CONSTRAINTS
84
85 =head2 C<name>
86
87 =over 4
88
89 =item * L</name>
90
91 =back
92
93 =cut
94
95 __PACKAGE__->add_unique_constraint("name", ["name"]);
96
97 =head1 RELATIONS
98
99 =head2 search_marc_to_fields
100
101 Type: has_many
102
103 Related object: L<Koha::Schema::Result::SearchMarcToField>
104
105 =cut
106
107 __PACKAGE__->has_many(
108   "search_marc_to_fields",
109   "Koha::Schema::Result::SearchMarcToField",
110   { "foreign.search_field_id" => "self.id" },
111   { cascade_copy => 0, cascade_delete => 0 },
112 );
113
114 =head2 search_marc_maps
115
116 Type: many_to_many
117
118 Composing rels: L</search_marc_to_fields> -> search_marc_map
119
120 =cut
121
122 __PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
123
124
125 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-25 15:21:43
126 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HD0m5hWYi/GXgz1rvk+Ipw
127
128
129 # You can replace this text with custom code or comments, and it will be preserved on regeneration
130 1;