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