Bug 22417: Remove record_type from BatchUpdate*
[koha.git] / Koha / Schema / Result / LibraryGroup.pm
1 use utf8;
2 package Koha::Schema::Result::LibraryGroup;
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::LibraryGroup
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<library_groups>
19
20 =cut
21
22 __PACKAGE__->table("library_groups");
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 parent_id
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 1
37
38 =head2 branchcode
39
40   data_type: 'varchar'
41   is_foreign_key: 1
42   is_nullable: 1
43   size: 10
44
45 =head2 title
46
47   data_type: 'varchar'
48   is_nullable: 1
49   size: 100
50
51 =head2 description
52
53   data_type: 'mediumtext'
54   is_nullable: 1
55
56 =head2 ft_hide_patron_info
57
58   data_type: 'tinyint'
59   default_value: 0
60   is_nullable: 0
61
62 =head2 ft_search_groups_opac
63
64   data_type: 'tinyint'
65   default_value: 0
66   is_nullable: 0
67
68 =head2 ft_search_groups_staff
69
70   data_type: 'tinyint'
71   default_value: 0
72   is_nullable: 0
73
74 =head2 ft_local_hold_group
75
76   data_type: 'tinyint'
77   default_value: 0
78   is_nullable: 0
79
80 =head2 created_on
81
82   data_type: 'timestamp'
83   datetime_undef_if_invalid: 1
84   is_nullable: 1
85
86 =head2 updated_on
87
88   data_type: 'timestamp'
89   datetime_undef_if_invalid: 1
90   default_value: current_timestamp
91   is_nullable: 0
92
93 =cut
94
95 __PACKAGE__->add_columns(
96   "id",
97   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
98   "parent_id",
99   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
100   "branchcode",
101   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
102   "title",
103   { data_type => "varchar", is_nullable => 1, size => 100 },
104   "description",
105   { data_type => "mediumtext", is_nullable => 1 },
106   "ft_hide_patron_info",
107   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
108   "ft_search_groups_opac",
109   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
110   "ft_search_groups_staff",
111   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
112   "ft_local_hold_group",
113   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
114   "created_on",
115   {
116     data_type => "timestamp",
117     datetime_undef_if_invalid => 1,
118     is_nullable => 1,
119   },
120   "updated_on",
121   {
122     data_type => "timestamp",
123     datetime_undef_if_invalid => 1,
124     default_value => \"current_timestamp",
125     is_nullable => 0,
126   },
127 );
128
129 =head1 PRIMARY KEY
130
131 =over 4
132
133 =item * L</id>
134
135 =back
136
137 =cut
138
139 __PACKAGE__->set_primary_key("id");
140
141 =head1 UNIQUE CONSTRAINTS
142
143 =head2 C<library_groups_uniq_2>
144
145 =over 4
146
147 =item * L</parent_id>
148
149 =item * L</branchcode>
150
151 =back
152
153 =cut
154
155 __PACKAGE__->add_unique_constraint("library_groups_uniq_2", ["parent_id", "branchcode"]);
156
157 =head2 C<title>
158
159 =over 4
160
161 =item * L</title>
162
163 =back
164
165 =cut
166
167 __PACKAGE__->add_unique_constraint("title", ["title"]);
168
169 =head1 RELATIONS
170
171 =head2 branchcode
172
173 Type: belongs_to
174
175 Related object: L<Koha::Schema::Result::Branch>
176
177 =cut
178
179 __PACKAGE__->belongs_to(
180   "branchcode",
181   "Koha::Schema::Result::Branch",
182   { branchcode => "branchcode" },
183   {
184     is_deferrable => 1,
185     join_type     => "LEFT",
186     on_delete     => "CASCADE",
187     on_update     => "CASCADE",
188   },
189 );
190
191 =head2 library_groups
192
193 Type: has_many
194
195 Related object: L<Koha::Schema::Result::LibraryGroup>
196
197 =cut
198
199 __PACKAGE__->has_many(
200   "library_groups",
201   "Koha::Schema::Result::LibraryGroup",
202   { "foreign.parent_id" => "self.id" },
203   { cascade_copy => 0, cascade_delete => 0 },
204 );
205
206 =head2 parent
207
208 Type: belongs_to
209
210 Related object: L<Koha::Schema::Result::LibraryGroup>
211
212 =cut
213
214 __PACKAGE__->belongs_to(
215   "parent",
216   "Koha::Schema::Result::LibraryGroup",
217   { id => "parent_id" },
218   {
219     is_deferrable => 1,
220     join_type     => "LEFT",
221     on_delete     => "CASCADE",
222     on_update     => "CASCADE",
223   },
224 );
225
226
227 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-30 15:43:39
228 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qg0Ckj0ZBRjSaQgEcvxSZA
229
230 sub koha_object_class {
231     'Koha::Library::Group';
232 }
233 sub koha_objects_class {
234     'Koha::Library::Groups';
235 }
236
237 __PACKAGE__->add_columns(
238     '+ft_hide_patron_info' => { is_boolean => 1 },
239     '+ft_search_groups_opac' => { is_boolean => 1 },
240     '+ft_search_groups_staff' => { is_boolean => 1 },
241     '+ft_local_hold_group' => { is_boolean => 1 },
242 );
243
244 1;