Bug 21066: DBIC schema changes
[koha.git] / Koha / Schema / Result / OpacNews.pm
1 use utf8;
2 package Koha::Schema::Result::OpacNews;
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::OpacNews
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<opac_news>
19
20 =cut
21
22 __PACKAGE__->table("opac_news");
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 =head2 branchcode
34
35   data_type: 'varchar'
36   is_foreign_key: 1
37   is_nullable: 1
38   size: 10
39
40 =head2 title
41
42   data_type: 'varchar'
43   default_value: (empty string)
44   is_nullable: 0
45   size: 250
46
47 =head2 content
48
49   data_type: 'mediumtext'
50   is_nullable: 0
51
52 =head2 lang
53
54   data_type: 'varchar'
55   default_value: (empty string)
56   is_nullable: 0
57   size: 50
58
59 =head2 published_on
60
61   data_type: 'date'
62   datetime_undef_if_invalid: 1
63   is_nullable: 1
64
65 =head2 updated_on
66
67   data_type: 'timestamp'
68   datetime_undef_if_invalid: 1
69   default_value: current_timestamp
70   is_nullable: 0
71
72 =head2 expirationdate
73
74   data_type: 'date'
75   datetime_undef_if_invalid: 1
76   is_nullable: 1
77
78 =head2 number
79
80   data_type: 'integer'
81   is_nullable: 1
82
83 =head2 borrowernumber
84
85   data_type: 'integer'
86   is_foreign_key: 1
87   is_nullable: 1
88
89 =cut
90
91 __PACKAGE__->add_columns(
92   "idnew",
93   {
94     data_type => "integer",
95     extra => { unsigned => 1 },
96     is_auto_increment => 1,
97     is_nullable => 0,
98   },
99   "branchcode",
100   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
101   "title",
102   { data_type => "varchar", default_value => "", is_nullable => 0, size => 250 },
103   "content",
104   { data_type => "mediumtext", is_nullable => 0 },
105   "lang",
106   { data_type => "varchar", default_value => "", is_nullable => 0, size => 50 },
107   "published_on",
108   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
109   "updated_on",
110   {
111     data_type => "timestamp",
112     datetime_undef_if_invalid => 1,
113     default_value => \"current_timestamp",
114     is_nullable => 0,
115   },
116   "expirationdate",
117   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
118   "number",
119   { data_type => "integer", is_nullable => 1 },
120   "borrowernumber",
121   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
122 );
123
124 =head1 PRIMARY KEY
125
126 =over 4
127
128 =item * L</idnew>
129
130 =back
131
132 =cut
133
134 __PACKAGE__->set_primary_key("idnew");
135
136 =head1 RELATIONS
137
138 =head2 borrowernumber
139
140 Type: belongs_to
141
142 Related object: L<Koha::Schema::Result::Borrower>
143
144 =cut
145
146 __PACKAGE__->belongs_to(
147   "borrowernumber",
148   "Koha::Schema::Result::Borrower",
149   { borrowernumber => "borrowernumber" },
150   {
151     is_deferrable => 1,
152     join_type     => "LEFT",
153     on_delete     => "SET NULL",
154     on_update     => "CASCADE",
155   },
156 );
157
158 =head2 branchcode
159
160 Type: belongs_to
161
162 Related object: L<Koha::Schema::Result::Branch>
163
164 =cut
165
166 __PACKAGE__->belongs_to(
167   "branchcode",
168   "Koha::Schema::Result::Branch",
169   { branchcode => "branchcode" },
170   {
171     is_deferrable => 1,
172     join_type     => "LEFT",
173     on_delete     => "CASCADE",
174     on_update     => "CASCADE",
175   },
176 );
177
178
179 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-09-02 12:50:13
180 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IKAwgZM6jqOTbksraZb21w
181
182 sub koha_object_class {
183     'Koha::NewsItem';
184 }
185 sub koha_objects_class {
186     'Koha::News';
187 }
188
189 1;