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