Bug 8976: DBIC schema changes
[koha.git] / Koha / Schema / Result / Course.pm
1 use utf8;
2 package Koha::Schema::Result::Course;
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::Course
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<courses>
19
20 =cut
21
22 __PACKAGE__->table("courses");
23
24 =head1 ACCESSORS
25
26 =head2 course_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 unique id for the course
33
34 =head2 department
35
36   data_type: 'varchar'
37   is_nullable: 1
38   size: 80
39
40 the authorised value for the DEPARTMENT
41
42 =head2 course_number
43
44   data_type: 'varchar'
45   is_nullable: 1
46   size: 255
47
48 the 'course number' assigned to a course
49
50 =head2 section
51
52   data_type: 'varchar'
53   is_nullable: 1
54   size: 255
55
56 the 'section' of a course
57
58 =head2 course_name
59
60   data_type: 'varchar'
61   is_nullable: 1
62   size: 255
63
64 the name of the course
65
66 =head2 term
67
68   data_type: 'varchar'
69   is_nullable: 1
70   size: 80
71
72 the authorised value for the TERM
73
74 =head2 staff_note
75
76   data_type: 'longtext'
77   is_nullable: 1
78
79 the text of the staff only note
80
81 =head2 public_note
82
83   data_type: 'longtext'
84   is_nullable: 1
85
86 the text of the public / opac note
87
88 =head2 students_count
89
90   data_type: 'varchar'
91   is_nullable: 1
92   size: 20
93
94 how many students will be taking this course/section
95
96 =head2 enabled
97
98   data_type: 'enum'
99   default_value: 'yes'
100   extra: {list => ["yes","no"]}
101   is_nullable: 0
102
103 determines whether the course is active
104
105 =head2 timestamp
106
107   data_type: 'timestamp'
108   datetime_undef_if_invalid: 1
109   default_value: current_timestamp
110   is_nullable: 0
111
112 =cut
113
114 __PACKAGE__->add_columns(
115   "course_id",
116   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
117   "department",
118   { data_type => "varchar", is_nullable => 1, size => 80 },
119   "course_number",
120   { data_type => "varchar", is_nullable => 1, size => 255 },
121   "section",
122   { data_type => "varchar", is_nullable => 1, size => 255 },
123   "course_name",
124   { data_type => "varchar", is_nullable => 1, size => 255 },
125   "term",
126   { data_type => "varchar", is_nullable => 1, size => 80 },
127   "staff_note",
128   { data_type => "longtext", is_nullable => 1 },
129   "public_note",
130   { data_type => "longtext", is_nullable => 1 },
131   "students_count",
132   { data_type => "varchar", is_nullable => 1, size => 20 },
133   "enabled",
134   {
135     data_type => "enum",
136     default_value => "yes",
137     extra => { list => ["yes", "no"] },
138     is_nullable => 0,
139   },
140   "timestamp",
141   {
142     data_type => "timestamp",
143     datetime_undef_if_invalid => 1,
144     default_value => \"current_timestamp",
145     is_nullable => 0,
146   },
147 );
148
149 =head1 PRIMARY KEY
150
151 =over 4
152
153 =item * L</course_id>
154
155 =back
156
157 =cut
158
159 __PACKAGE__->set_primary_key("course_id");
160
161 =head1 RELATIONS
162
163 =head2 course_instructors
164
165 Type: has_many
166
167 Related object: L<Koha::Schema::Result::CourseInstructor>
168
169 =cut
170
171 __PACKAGE__->has_many(
172   "course_instructors",
173   "Koha::Schema::Result::CourseInstructor",
174   { "foreign.course_id" => "self.course_id" },
175   { cascade_copy => 0, cascade_delete => 0 },
176 );
177
178 =head2 course_reserves
179
180 Type: has_many
181
182 Related object: L<Koha::Schema::Result::CourseReserve>
183
184 =cut
185
186 __PACKAGE__->has_many(
187   "course_reserves",
188   "Koha::Schema::Result::CourseReserve",
189   { "foreign.course_id" => "self.course_id" },
190   { cascade_copy => 0, cascade_delete => 0 },
191 );
192
193 =head2 borrowernumbers
194
195 Type: many_to_many
196
197 Composing rels: L</course_instructors> -> borrowernumber
198
199 =cut
200
201 __PACKAGE__->many_to_many("borrowernumbers", "course_instructors", "borrowernumber");
202
203
204 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
205 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Yoy4Un1rFmPk2EJW7Rf5/g
206
207
208 # You can replace this text with custom content, and it will be preserved on regeneration
209 1;