Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / Schema / Result / AdditionalContent.pm
1 use utf8;
2 package Koha::Schema::Result::AdditionalContent;
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::AdditionalContent
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<additional_contents>
19
20 =cut
21
22 __PACKAGE__->table("additional_contents");
23
24 =head1 ACCESSORS
25
26 =head2 idnew
27
28   data_type: 'integer'
29   extra: {unsigned => 1}
30   is_auto_increment: 1
31   is_nullable: 0
32
33 unique identifier for the additional content
34
35 =head2 category
36
37   data_type: 'varchar'
38   is_nullable: 0
39   size: 20
40
41 category for the additional content
42
43 =head2 code
44
45   data_type: 'varchar'
46   is_nullable: 0
47   size: 100
48
49 code to group content per lang
50
51 =head2 location
52
53   data_type: 'varchar'
54   is_nullable: 0
55   size: 255
56
57 location of the additional content
58
59 =head2 branchcode
60
61   data_type: 'varchar'
62   is_foreign_key: 1
63   is_nullable: 1
64   size: 10
65
66 branch code users to create branch specific additional content, NULL is every branch.
67
68 =head2 title
69
70   data_type: 'varchar'
71   default_value: (empty string)
72   is_nullable: 0
73   size: 250
74
75 title of the additional content
76
77 =head2 content
78
79   data_type: 'mediumtext'
80   is_nullable: 0
81
82 the body of your additional content
83
84 =head2 lang
85
86   data_type: 'varchar'
87   default_value: (empty string)
88   is_nullable: 0
89   size: 50
90
91 location for the additional content(koha is the staff interface, slip is the circulation receipt and language codes are for the opac)
92
93 =head2 published_on
94
95   data_type: 'date'
96   datetime_undef_if_invalid: 1
97   is_nullable: 1
98
99 publication date
100
101 =head2 updated_on
102
103   data_type: 'timestamp'
104   datetime_undef_if_invalid: 1
105   default_value: current_timestamp
106   is_nullable: 0
107
108 last modification
109
110 =head2 expirationdate
111
112   data_type: 'date'
113   datetime_undef_if_invalid: 1
114   is_nullable: 1
115
116 date the additional content is set to expire or no longer be visible
117
118 =head2 number
119
120   data_type: 'integer'
121   is_nullable: 1
122
123 the order in which this additional content appears in that specific location
124
125 =head2 borrowernumber
126
127   data_type: 'integer'
128   is_foreign_key: 1
129   is_nullable: 1
130
131 The user who created the additional content
132
133 =cut
134
135 __PACKAGE__->add_columns(
136   "idnew",
137   {
138     data_type => "integer",
139     extra => { unsigned => 1 },
140     is_auto_increment => 1,
141     is_nullable => 0,
142   },
143   "category",
144   { data_type => "varchar", is_nullable => 0, size => 20 },
145   "code",
146   { data_type => "varchar", is_nullable => 0, size => 100 },
147   "location",
148   { data_type => "varchar", is_nullable => 0, size => 255 },
149   "branchcode",
150   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
151   "title",
152   { data_type => "varchar", default_value => "", is_nullable => 0, size => 250 },
153   "content",
154   { data_type => "mediumtext", is_nullable => 0 },
155   "lang",
156   { data_type => "varchar", default_value => "", is_nullable => 0, size => 50 },
157   "published_on",
158   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
159   "updated_on",
160   {
161     data_type => "timestamp",
162     datetime_undef_if_invalid => 1,
163     default_value => \"current_timestamp",
164     is_nullable => 0,
165   },
166   "expirationdate",
167   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
168   "number",
169   { data_type => "integer", is_nullable => 1 },
170   "borrowernumber",
171   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
172 );
173
174 =head1 PRIMARY KEY
175
176 =over 4
177
178 =item * L</idnew>
179
180 =back
181
182 =cut
183
184 __PACKAGE__->set_primary_key("idnew");
185
186 =head1 UNIQUE CONSTRAINTS
187
188 =head2 C<additional_contents_uniq>
189
190 =over 4
191
192 =item * L</category>
193
194 =item * L</code>
195
196 =item * L</branchcode>
197
198 =item * L</lang>
199
200 =back
201
202 =cut
203
204 __PACKAGE__->add_unique_constraint(
205   "additional_contents_uniq",
206   ["category", "code", "branchcode", "lang"],
207 );
208
209 =head1 RELATIONS
210
211 =head2 borrowernumber
212
213 Type: belongs_to
214
215 Related object: L<Koha::Schema::Result::Borrower>
216
217 =cut
218
219 __PACKAGE__->belongs_to(
220   "borrowernumber",
221   "Koha::Schema::Result::Borrower",
222   { borrowernumber => "borrowernumber" },
223   {
224     is_deferrable => 1,
225     join_type     => "LEFT",
226     on_delete     => "SET NULL",
227     on_update     => "CASCADE",
228   },
229 );
230
231 =head2 branchcode
232
233 Type: belongs_to
234
235 Related object: L<Koha::Schema::Result::Branch>
236
237 =cut
238
239 __PACKAGE__->belongs_to(
240   "branchcode",
241   "Koha::Schema::Result::Branch",
242   { branchcode => "branchcode" },
243   {
244     is_deferrable => 1,
245     join_type     => "LEFT",
246     on_delete     => "CASCADE",
247     on_update     => "CASCADE",
248   },
249 );
250
251
252 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-02-02 07:12:59
253 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/h/wWfmyVxW7skwrMn3scg
254
255
256 # You can replace this text with custom code or comments, and it will be preserved on regeneration
257 1;