Bug 12478: update the schema
[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 =cut
57
58 __PACKAGE__->add_columns(
59   "id",
60   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
61   "index_name",
62   {
63     data_type => "enum",
64     extra => { list => ["biblios", "authorities"] },
65     is_nullable => 0,
66   },
67   "marc_type",
68   {
69     data_type => "enum",
70     extra => { list => ["marc21", "unimarc", "normarc"] },
71     is_nullable => 0,
72   },
73   "marc_field",
74   { data_type => "varchar", is_nullable => 0, size => 255 },
75 );
76
77 =head1 PRIMARY KEY
78
79 =over 4
80
81 =item * L</id>
82
83 =back
84
85 =cut
86
87 __PACKAGE__->set_primary_key("id");
88
89 =head1 UNIQUE CONSTRAINTS
90
91 =head2 C<index_name>
92
93 =over 4
94
95 =item * L</index_name>
96
97 =item * L</marc_field>
98
99 =item * L</marc_type>
100
101 =back
102
103 =cut
104
105 __PACKAGE__->add_unique_constraint("index_name", ["index_name", "marc_field", "marc_type"]);
106
107 =head1 RELATIONS
108
109 =head2 search_marc_to_fields
110
111 Type: has_many
112
113 Related object: L<Koha::Schema::Result::SearchMarcToField>
114
115 =cut
116
117 __PACKAGE__->has_many(
118   "search_marc_to_fields",
119   "Koha::Schema::Result::SearchMarcToField",
120   { "foreign.search_marc_map_id" => "self.id" },
121   { cascade_copy => 0, cascade_delete => 0 },
122 );
123
124
125 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-12 16:41:47
126 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nKMOxnAJST3zNN6Kxj2ynA
127
128
129 # You can replace this text with custom code or comments, and it will be preserved on regeneration
130 1;