Bug 33606: (QA follow-up) Cosmetic changes
[koha.git] / Koha / Schema / Result / CourseReserve.pm
1 use utf8;
2 package Koha::Schema::Result::CourseReserve;
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::CourseReserve
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<course_reserves>
19
20 =cut
21
22 __PACKAGE__->table("course_reserves");
23
24 =head1 ACCESSORS
25
26 =head2 cr_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 course_id
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 0
37
38 foreign key to link to courses.course_id
39
40 =head2 ci_id
41
42   data_type: 'integer'
43   is_foreign_key: 1
44   is_nullable: 0
45
46 foreign key to link to courses_items.ci_id
47
48 =head2 staff_note
49
50   data_type: 'longtext'
51   is_nullable: 1
52
53 staff only note
54
55 =head2 public_note
56
57   data_type: 'longtext'
58   is_nullable: 1
59
60 public, OPAC visible note
61
62 =head2 timestamp
63
64   data_type: 'timestamp'
65   datetime_undef_if_invalid: 1
66   default_value: current_timestamp
67   is_nullable: 0
68
69 =cut
70
71 __PACKAGE__->add_columns(
72   "cr_id",
73   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
74   "course_id",
75   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
76   "ci_id",
77   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
78   "staff_note",
79   { data_type => "longtext", is_nullable => 1 },
80   "public_note",
81   { data_type => "longtext", is_nullable => 1 },
82   "timestamp",
83   {
84     data_type => "timestamp",
85     datetime_undef_if_invalid => 1,
86     default_value => \"current_timestamp",
87     is_nullable => 0,
88   },
89 );
90
91 =head1 PRIMARY KEY
92
93 =over 4
94
95 =item * L</cr_id>
96
97 =back
98
99 =cut
100
101 __PACKAGE__->set_primary_key("cr_id");
102
103 =head1 UNIQUE CONSTRAINTS
104
105 =head2 C<pseudo_key>
106
107 =over 4
108
109 =item * L</course_id>
110
111 =item * L</ci_id>
112
113 =back
114
115 =cut
116
117 __PACKAGE__->add_unique_constraint("pseudo_key", ["course_id", "ci_id"]);
118
119 =head1 RELATIONS
120
121 =head2 ci
122
123 Type: belongs_to
124
125 Related object: L<Koha::Schema::Result::CourseItem>
126
127 =cut
128
129 __PACKAGE__->belongs_to(
130   "ci",
131   "Koha::Schema::Result::CourseItem",
132   { ci_id => "ci_id" },
133   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
134 );
135
136 =head2 course
137
138 Type: belongs_to
139
140 Related object: L<Koha::Schema::Result::Course>
141
142 =cut
143
144 __PACKAGE__->belongs_to(
145   "course",
146   "Koha::Schema::Result::Course",
147   { course_id => "course_id" },
148   { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
149 );
150
151
152 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
153 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:K3co29iVHAcF2/S0tGT1LA
154
155 sub koha_objects_class {
156     'Koha::Course::Reserves';
157 }
158 sub koha_object_class {
159     'Koha::Course::Reserve';
160 }
161
162 1;