Line 0
Link Here
|
|
|
1 |
use utf8; |
2 |
package Koha::Schema::Result::Configuration; |
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::Configuration |
10 |
|
11 |
=cut |
12 |
|
13 |
use strict; |
14 |
use warnings; |
15 |
|
16 |
use base 'DBIx::Class::Core'; |
17 |
|
18 |
=head1 TABLE: C<configurations> |
19 |
|
20 |
=cut |
21 |
|
22 |
__PACKAGE__->table("configurations"); |
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 library_id |
33 |
|
34 |
data_type: 'varchar' |
35 |
is_foreign_key: 1 |
36 |
is_nullable: 1 |
37 |
size: 10 |
38 |
|
39 |
=head2 category_id |
40 |
|
41 |
data_type: 'varchar' |
42 |
is_foreign_key: 1 |
43 |
is_nullable: 1 |
44 |
size: 10 |
45 |
|
46 |
=head2 item_type |
47 |
|
48 |
data_type: 'varchar' |
49 |
is_foreign_key: 1 |
50 |
is_nullable: 1 |
51 |
size: 10 |
52 |
|
53 |
=head2 name |
54 |
|
55 |
data_type: 'varchar' |
56 |
is_nullable: 0 |
57 |
size: 32 |
58 |
|
59 |
=head2 value |
60 |
|
61 |
data_type: 'mediumtext' |
62 |
is_nullable: 1 |
63 |
|
64 |
=head2 type |
65 |
|
66 |
data_type: 'enum' |
67 |
default_value: 'text' |
68 |
extra: {list => ["text","boolean","integer"]} |
69 |
is_nullable: 0 |
70 |
|
71 |
=cut |
72 |
|
73 |
__PACKAGE__->add_columns( |
74 |
"id", |
75 |
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, |
76 |
"library_id", |
77 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
78 |
"category_id", |
79 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
80 |
"item_type", |
81 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
82 |
"name", |
83 |
{ data_type => "varchar", is_nullable => 0, size => 32 }, |
84 |
"value", |
85 |
{ data_type => "mediumtext", is_nullable => 1 }, |
86 |
"type", |
87 |
{ |
88 |
data_type => "enum", |
89 |
default_value => "text", |
90 |
extra => { list => ["text", "boolean", "integer"] }, |
91 |
is_nullable => 0, |
92 |
}, |
93 |
); |
94 |
|
95 |
=head1 PRIMARY KEY |
96 |
|
97 |
=over 4 |
98 |
|
99 |
=item * L</id> |
100 |
|
101 |
=back |
102 |
|
103 |
=cut |
104 |
|
105 |
__PACKAGE__->set_primary_key("id"); |
106 |
|
107 |
=head1 UNIQUE CONSTRAINTS |
108 |
|
109 |
=head2 C<library_id> |
110 |
|
111 |
=over 4 |
112 |
|
113 |
=item * L</library_id> |
114 |
|
115 |
=item * L</category_id> |
116 |
|
117 |
=item * L</item_type> |
118 |
|
119 |
=item * L</name> |
120 |
|
121 |
=back |
122 |
|
123 |
=cut |
124 |
|
125 |
__PACKAGE__->add_unique_constraint( |
126 |
"library_id", |
127 |
["library_id", "category_id", "item_type", "name"], |
128 |
); |
129 |
|
130 |
=head1 RELATIONS |
131 |
|
132 |
=head2 category |
133 |
|
134 |
Type: belongs_to |
135 |
|
136 |
Related object: L<Koha::Schema::Result::Category> |
137 |
|
138 |
=cut |
139 |
|
140 |
__PACKAGE__->belongs_to( |
141 |
"category", |
142 |
"Koha::Schema::Result::Category", |
143 |
{ categorycode => "category_id" }, |
144 |
{ |
145 |
is_deferrable => 1, |
146 |
join_type => "LEFT", |
147 |
on_delete => "CASCADE", |
148 |
on_update => "CASCADE", |
149 |
}, |
150 |
); |
151 |
|
152 |
=head2 item_type |
153 |
|
154 |
Type: belongs_to |
155 |
|
156 |
Related object: L<Koha::Schema::Result::Itemtype> |
157 |
|
158 |
=cut |
159 |
|
160 |
__PACKAGE__->belongs_to( |
161 |
"item_type", |
162 |
"Koha::Schema::Result::Itemtype", |
163 |
{ itemtype => "item_type" }, |
164 |
{ |
165 |
is_deferrable => 1, |
166 |
join_type => "LEFT", |
167 |
on_delete => "CASCADE", |
168 |
on_update => "CASCADE", |
169 |
}, |
170 |
); |
171 |
|
172 |
=head2 library |
173 |
|
174 |
Type: belongs_to |
175 |
|
176 |
Related object: L<Koha::Schema::Result::Branch> |
177 |
|
178 |
=cut |
179 |
|
180 |
__PACKAGE__->belongs_to( |
181 |
"library", |
182 |
"Koha::Schema::Result::Branch", |
183 |
{ branchcode => "library_id" }, |
184 |
{ |
185 |
is_deferrable => 1, |
186 |
join_type => "LEFT", |
187 |
on_delete => "CASCADE", |
188 |
on_update => "CASCADE", |
189 |
}, |
190 |
); |
191 |
|
192 |
|
193 |
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-08-03 17:21:00 |
194 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SCRluJvwzSovqN3pVW7omA |
195 |
|
196 |
|
197 |
# You can replace this text with custom code or comments, and it will be preserved on regeneration |
198 |
1; |