Bug 24474: (QA follow-up) Fix failing test
[koha.git] / Koha / Schema / Result / Course.pm
blobcd1ede28e356da46376ba0d66396649feca8e9e1
1 use utf8;
2 package Koha::Schema::Result::Course;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::Course
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<courses>
20 =cut
22 __PACKAGE__->table("courses");
24 =head1 ACCESSORS
26 =head2 course_id
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 department
34 data_type: 'varchar'
35 is_nullable: 1
36 size: 80
38 =head2 course_number
40 data_type: 'varchar'
41 is_nullable: 1
42 size: 255
44 =head2 section
46 data_type: 'varchar'
47 is_nullable: 1
48 size: 255
50 =head2 course_name
52 data_type: 'varchar'
53 is_nullable: 1
54 size: 255
56 =head2 term
58 data_type: 'varchar'
59 is_nullable: 1
60 size: 80
62 =head2 staff_note
64 data_type: 'longtext'
65 is_nullable: 1
67 =head2 public_note
69 data_type: 'longtext'
70 is_nullable: 1
72 =head2 students_count
74 data_type: 'varchar'
75 is_nullable: 1
76 size: 20
78 =head2 enabled
80 data_type: 'enum'
81 default_value: 'yes'
82 extra: {list => ["yes","no"]}
83 is_nullable: 0
85 =head2 timestamp
87 data_type: 'timestamp'
88 datetime_undef_if_invalid: 1
89 default_value: current_timestamp
90 is_nullable: 0
92 =cut
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 => "longtext", is_nullable => 1 },
109 "public_note",
110 { data_type => "longtext", is_nullable => 1 },
111 "students_count",
112 { data_type => "varchar", is_nullable => 1, size => 20 },
113 "enabled",
115 data_type => "enum",
116 default_value => "yes",
117 extra => { list => ["yes", "no"] },
118 is_nullable => 0,
120 "timestamp",
122 data_type => "timestamp",
123 datetime_undef_if_invalid => 1,
124 default_value => \"current_timestamp",
125 is_nullable => 0,
129 =head1 PRIMARY KEY
131 =over 4
133 =item * L</course_id>
135 =back
137 =cut
139 __PACKAGE__->set_primary_key("course_id");
141 =head1 RELATIONS
143 =head2 course_instructors
145 Type: has_many
147 Related object: L<Koha::Schema::Result::CourseInstructor>
149 =cut
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 },
158 =head2 course_reserves
160 Type: has_many
162 Related object: L<Koha::Schema::Result::CourseReserve>
164 =cut
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 },
173 =head2 borrowernumbers
175 Type: many_to_many
177 Composing rels: L</course_instructors> -> borrowernumber
179 =cut
181 __PACKAGE__->many_to_many("borrowernumbers", "course_instructors", "borrowernumber");
184 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53
185 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:o0EBOuJCHxH5IG/PgsJfxg
188 # You can replace this text with custom content, and it will be preserved on regeneration