Bug 16829: DBIx update
[koha.git] / Koha / Schema / Result / CourseItem.pm
blob1766302449c5a5ba2ba862982f493f598449af54
1 use utf8;
2 package Koha::Schema::Result::CourseItem;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::CourseItem
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<course_items>
20 =cut
22 __PACKAGE__->table("course_items");
24 =head1 ACCESSORS
26 =head2 ci_id
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 itemnumber
34 data_type: 'integer'
35 is_foreign_key: 1
36 is_nullable: 0
38 =head2 itype
40 data_type: 'varchar'
41 is_nullable: 1
42 size: 10
44 =head2 ccode
46 data_type: 'varchar'
47 is_nullable: 1
48 size: 10
50 =head2 holdingbranch
52 data_type: 'varchar'
53 is_foreign_key: 1
54 is_nullable: 1
55 size: 10
57 =head2 location
59 data_type: 'varchar'
60 is_nullable: 1
61 size: 80
63 =head2 enabled
65 data_type: 'enum'
66 default_value: 'no'
67 extra: {list => ["yes","no"]}
68 is_nullable: 0
70 =head2 timestamp
72 data_type: 'timestamp'
73 datetime_undef_if_invalid: 1
74 default_value: current_timestamp
75 is_nullable: 0
77 =cut
79 __PACKAGE__->add_columns(
80 "ci_id",
81 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
82 "itemnumber",
83 { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
84 "itype",
85 { data_type => "varchar", is_nullable => 1, size => 10 },
86 "ccode",
87 { data_type => "varchar", is_nullable => 1, size => 10 },
88 "holdingbranch",
89 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
90 "location",
91 { data_type => "varchar", is_nullable => 1, size => 80 },
92 "enabled",
94 data_type => "enum",
95 default_value => "no",
96 extra => { list => ["yes", "no"] },
97 is_nullable => 0,
99 "timestamp",
101 data_type => "timestamp",
102 datetime_undef_if_invalid => 1,
103 default_value => \"current_timestamp",
104 is_nullable => 0,
108 =head1 PRIMARY KEY
110 =over 4
112 =item * L</ci_id>
114 =back
116 =cut
118 __PACKAGE__->set_primary_key("ci_id");
120 =head1 UNIQUE CONSTRAINTS
122 =head2 C<itemnumber>
124 =over 4
126 =item * L</itemnumber>
128 =back
130 =cut
132 __PACKAGE__->add_unique_constraint("itemnumber", ["itemnumber"]);
134 =head1 RELATIONS
136 =head2 course_reserves
138 Type: has_many
140 Related object: L<Koha::Schema::Result::CourseReserve>
142 =cut
144 __PACKAGE__->has_many(
145 "course_reserves",
146 "Koha::Schema::Result::CourseReserve",
147 { "foreign.ci_id" => "self.ci_id" },
148 { cascade_copy => 0, cascade_delete => 0 },
151 =head2 holdingbranch
153 Type: belongs_to
155 Related object: L<Koha::Schema::Result::Branch>
157 =cut
159 __PACKAGE__->belongs_to(
160 "holdingbranch",
161 "Koha::Schema::Result::Branch",
162 { branchcode => "holdingbranch" },
164 is_deferrable => 1,
165 join_type => "LEFT",
166 on_delete => "CASCADE",
167 on_update => "CASCADE",
171 =head2 itemnumber
173 Type: belongs_to
175 Related object: L<Koha::Schema::Result::Item>
177 =cut
179 __PACKAGE__->belongs_to(
180 "itemnumber",
181 "Koha::Schema::Result::Item",
182 { itemnumber => "itemnumber" },
183 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
187 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-09-02 09:46:54
188 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:g5lEeHNvnM4KIb6AJUxDOw
191 # You can replace this text with custom content, and it will be preserved on regeneration