Bug 7295: (follow-up) update DBIx::Class schema classes
[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 =head2 department
33
34   data_type: 'varchar'
35   is_nullable: 1
36   size: 80
37
38 =head2 course_number
39
40   data_type: 'varchar'
41   is_nullable: 1
42   size: 255
43
44 =head2 section
45
46   data_type: 'varchar'
47   is_nullable: 1
48   size: 255
49
50 =head2 course_name
51
52   data_type: 'varchar'
53   is_nullable: 1
54   size: 255
55
56 =head2 term
57
58   data_type: 'varchar'
59   is_nullable: 1
60   size: 80
61
62 =head2 staff_note
63
64   data_type: 'mediumtext'
65   is_nullable: 1
66
67 =head2 public_note
68
69   data_type: 'mediumtext'
70   is_nullable: 1
71
72 =head2 students_count
73
74   data_type: 'varchar'
75   is_nullable: 1
76   size: 20
77
78 =head2 enabled
79
80   data_type: 'enum'
81   default_value: 'yes'
82   extra: {list => ["yes","no"]}
83   is_nullable: 0
84
85 =head2 timestamp
86
87   data_type: 'timestamp'
88   datetime_undef_if_invalid: 1
89   default_value: current_timestamp
90   is_nullable: 0
91
92 =cut
93
94 __PACKAGE__->add_columns(
95   "course_id",
96   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
97   "department",
98   { data_type => "varchar", is_nullable => 1, size => 80 },
99   "course_number",
100   { data_type => "varchar", is_nullable => 1, size => 255 },
101   "section",
102   { data_type => "varchar", is_nullable => 1, size => 255 },
103   "course_name",
104   { data_type => "varchar", is_nullable => 1, size => 255 },
105   "term",
106   { data_type => "varchar", is_nullable => 1, size => 80 },
107   "staff_note",
108   { data_type => "mediumtext", is_nullable => 1 },
109   "public_note",
110   { data_type => "mediumtext", is_nullable => 1 },
111   "students_count",
112   { data_type => "varchar", is_nullable => 1, size => 20 },
113   "enabled",
114   {
115     data_type => "enum",
116     default_value => "yes",
117     extra => { list => ["yes", "no"] },
118     is_nullable => 0,
119   },
120   "timestamp",
121   {
122     data_type => "timestamp",
123     datetime_undef_if_invalid => 1,
124     default_value => \"current_timestamp",
125     is_nullable => 0,
126   },
127 );
128
129 =head1 PRIMARY KEY
130
131 =over 4
132
133 =item * L</course_id>
134
135 =back
136
137 =cut
138
139 __PACKAGE__->set_primary_key("course_id");
140
141 =head1 RELATIONS
142
143 =head2 course_instructors
144
145 Type: has_many
146
147 Related object: L<Koha::Schema::Result::CourseInstructor>
148
149 =cut
150
151 __PACKAGE__->has_many(
152   "course_instructors",
153   "Koha::Schema::Result::CourseInstructor",
154   { "foreign.course_id" => "self.course_id" },
155   { cascade_copy => 0, cascade_delete => 0 },
156 );
157
158 =head2 course_reserves
159
160 Type: has_many
161
162 Related object: L<Koha::Schema::Result::CourseReserve>
163
164 =cut
165
166 __PACKAGE__->has_many(
167   "course_reserves",
168   "Koha::Schema::Result::CourseReserve",
169   { "foreign.course_id" => "self.course_id" },
170   { cascade_copy => 0, cascade_delete => 0 },
171 );
172
173 =head2 borrowernumbers
174
175 Type: many_to_many
176
177 Composing rels: L</course_instructors> -> borrowernumber
178
179 =cut
180
181 __PACKAGE__->many_to_many("borrowernumbers", "course_instructors", "borrowernumber");
182
183
184 # Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
185 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:crKCFQ80qo2p885ebiBfnw
186
187
188 # You can replace this text with custom content, and it will be preserved on regeneration
189 1;