Bug 23727: Update Schema
[koha.git] / Koha / Schema / Result / AuthorisedValue.pm
1 use utf8;
2 package Koha::Schema::Result::AuthorisedValue;
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::AuthorisedValue
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<authorised_values>
19
20 =cut
21
22 __PACKAGE__->table("authorised_values");
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 category
33
34   data_type: 'varchar'
35   default_value: (empty string)
36   is_foreign_key: 1
37   is_nullable: 0
38   size: 32
39
40 =head2 authorised_value
41
42   data_type: 'varchar'
43   default_value: (empty string)
44   is_nullable: 0
45   size: 80
46
47 =head2 lib
48
49   data_type: 'varchar'
50   is_nullable: 1
51   size: 200
52
53 =head2 lib_opac
54
55   data_type: 'varchar'
56   is_nullable: 1
57   size: 200
58
59 =head2 imageurl
60
61   data_type: 'varchar'
62   is_nullable: 1
63   size: 200
64
65 =cut
66
67 __PACKAGE__->add_columns(
68   "id",
69   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
70   "category",
71   {
72     data_type => "varchar",
73     default_value => "",
74     is_foreign_key => 1,
75     is_nullable => 0,
76     size => 32,
77   },
78   "authorised_value",
79   { data_type => "varchar", default_value => "", is_nullable => 0, size => 80 },
80   "lib",
81   { data_type => "varchar", is_nullable => 1, size => 200 },
82   "lib_opac",
83   { data_type => "varchar", is_nullable => 1, size => 200 },
84   "imageurl",
85   { data_type => "varchar", is_nullable => 1, size => 200 },
86 );
87
88 =head1 PRIMARY KEY
89
90 =over 4
91
92 =item * L</id>
93
94 =back
95
96 =cut
97
98 __PACKAGE__->set_primary_key("id");
99
100 =head1 UNIQUE CONSTRAINTS
101
102 =head2 C<av_uniq>
103
104 =over 4
105
106 =item * L</category>
107
108 =item * L</authorised_value>
109
110 =back
111
112 =cut
113
114 __PACKAGE__->add_unique_constraint("av_uniq", ["category", "authorised_value"]);
115
116 =head1 RELATIONS
117
118 =head2 authorised_values_branches
119
120 Type: has_many
121
122 Related object: L<Koha::Schema::Result::AuthorisedValuesBranch>
123
124 =cut
125
126 __PACKAGE__->has_many(
127   "authorised_values_branches",
128   "Koha::Schema::Result::AuthorisedValuesBranch",
129   { "foreign.av_id" => "self.id" },
130   { cascade_copy => 0, cascade_delete => 0 },
131 );
132
133 =head2 category
134
135 Type: belongs_to
136
137 Related object: L<Koha::Schema::Result::AuthorisedValueCategory>
138
139 =cut
140
141 __PACKAGE__->belongs_to(
142   "category",
143   "Koha::Schema::Result::AuthorisedValueCategory",
144   { category_name => "category" },
145   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
146 );
147
148 =head2 illrequests
149
150 Type: has_many
151
152 Related object: L<Koha::Schema::Result::Illrequest>
153
154 =cut
155
156 __PACKAGE__->has_many(
157   "illrequests",
158   "Koha::Schema::Result::Illrequest",
159   { "foreign.status_alias" => "self.authorised_value" },
160   { cascade_copy => 0, cascade_delete => 0 },
161 );
162
163
164 # Created by DBIx::Class::Schema::Loader v0.07048 @ 2020-04-07 11:23:19
165 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6MjWlDqdpIOwsJlyjQawAg
166
167
168 # You can replace this text with custom code or comments, and it will be preserved on regeneration
169 1;