Bug 16034: (followup) Fix DB update and schema files
[koha.git] / Koha / Schema / Result / ClubEnrollment.pm
1 use utf8;
2 package Koha::Schema::Result::ClubEnrollment;
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::ClubEnrollment
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<club_enrollments>
19
20 =cut
21
22 __PACKAGE__->table("club_enrollments");
23
24 =head1 ACCESSORS
25
26 =head2 id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 club_id
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 0
37
38 =head2 borrowernumber
39
40   data_type: 'integer'
41   is_foreign_key: 1
42   is_nullable: 0
43
44 =head2 date_enrolled
45
46   data_type: 'timestamp'
47   datetime_undef_if_invalid: 1
48   default_value: current_timestamp
49   is_nullable: 0
50
51 =head2 date_canceled
52
53   data_type: 'timestamp'
54   datetime_undef_if_invalid: 1
55   is_nullable: 1
56
57 =head2 date_created
58
59   data_type: 'timestamp'
60   datetime_undef_if_invalid: 1
61   default_value: '0000-00-00 00:00:00'
62   is_nullable: 0
63
64 =head2 date_updated
65
66   data_type: 'timestamp'
67   datetime_undef_if_invalid: 1
68   is_nullable: 1
69
70 =head2 branchcode
71
72   data_type: 'varchar'
73   is_foreign_key: 1
74   is_nullable: 1
75   size: 11
76
77 =cut
78
79 __PACKAGE__->add_columns(
80   "id",
81   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
82   "club_id",
83   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
84   "borrowernumber",
85   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
86   "date_enrolled",
87   {
88     data_type => "timestamp",
89     datetime_undef_if_invalid => 1,
90     default_value => \"current_timestamp",
91     is_nullable => 0,
92   },
93   "date_canceled",
94   {
95     data_type => "timestamp",
96     datetime_undef_if_invalid => 1,
97     is_nullable => 1,
98   },
99   "date_created",
100   {
101     data_type => "timestamp",
102     datetime_undef_if_invalid => 1,
103     default_value => "0000-00-00 00:00:00",
104     is_nullable => 0,
105   },
106   "date_updated",
107   {
108     data_type => "timestamp",
109     datetime_undef_if_invalid => 1,
110     is_nullable => 1,
111   },
112   "branchcode",
113   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 11 },
114 );
115
116 =head1 PRIMARY KEY
117
118 =over 4
119
120 =item * L</id>
121
122 =back
123
124 =cut
125
126 __PACKAGE__->set_primary_key("id");
127
128 =head1 RELATIONS
129
130 =head2 borrowernumber
131
132 Type: belongs_to
133
134 Related object: L<Koha::Schema::Result::Borrower>
135
136 =cut
137
138 __PACKAGE__->belongs_to(
139   "borrowernumber",
140   "Koha::Schema::Result::Borrower",
141   { borrowernumber => "borrowernumber" },
142   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
143 );
144
145 =head2 branchcode
146
147 Type: belongs_to
148
149 Related object: L<Koha::Schema::Result::Branch>
150
151 =cut
152
153 __PACKAGE__->belongs_to(
154   "branchcode",
155   "Koha::Schema::Result::Branch",
156   { branchcode => "branchcode" },
157   {
158     is_deferrable => 1,
159     join_type     => "LEFT",
160     on_delete     => "SET NULL",
161     on_update     => "CASCADE",
162   },
163 );
164
165 =head2 club
166
167 Type: belongs_to
168
169 Related object: L<Koha::Schema::Result::Club>
170
171 =cut
172
173 __PACKAGE__->belongs_to(
174   "club",
175   "Koha::Schema::Result::Club",
176   { id => "club_id" },
177   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
178 );
179
180 =head2 club_enrollment_fields
181
182 Type: has_many
183
184 Related object: L<Koha::Schema::Result::ClubEnrollmentField>
185
186 =cut
187
188 __PACKAGE__->has_many(
189   "club_enrollment_fields",
190   "Koha::Schema::Result::ClubEnrollmentField",
191   { "foreign.club_enrollment_id" => "self.id" },
192   { cascade_copy => 0, cascade_delete => 0 },
193 );
194
195
196 # Created by DBIx::Class::Schema::Loader v0.07040 @ 2015-01-12 09:56:17
197 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9ypc+smG/VlgtWW66PhvHQ
198
199
200 # You can replace this text with custom content, and it will be preserved on regeneration
201 1;