Bug 30275: (QA follow-up) Rename columns to match API
[koha-ffzg.git] / Koha / Schema / Result / CheckoutRenewal.pm
1 use utf8;
2 package Koha::Schema::Result::CheckoutRenewal;
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::CheckoutRenewal
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<checkout_renewals>
19
20 =cut
21
22 __PACKAGE__->table("checkout_renewals");
23
24 =head1 ACCESSORS
25
26 =head2 renewal_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 checkout_id
33
34   data_type: 'integer'
35   is_nullable: 1
36
37 the id of the checkout this renewal pertains to
38
39 =head2 renewer_id
40
41   data_type: 'integer'
42   is_foreign_key: 1
43   is_nullable: 1
44
45 the id of the user who processed the renewal
46
47 =head2 seen
48
49   data_type: 'tinyint'
50   default_value: 0
51   is_nullable: 1
52
53 boolean denoting whether the item was present or not
54
55 =head2 interface
56
57   data_type: 'varchar'
58   is_nullable: 0
59   size: 16
60
61 the interface this renewal took place on
62
63 =head2 timestamp
64
65   data_type: 'timestamp'
66   datetime_undef_if_invalid: 1
67   default_value: current_timestamp
68   is_nullable: 0
69
70 the date and time the renewal took place
71
72 =cut
73
74 __PACKAGE__->add_columns(
75   "renewal_id",
76   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
77   "checkout_id",
78   { data_type => "integer", is_nullable => 1 },
79   "renewer_id",
80   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
81   "seen",
82   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
83   "interface",
84   { data_type => "varchar", is_nullable => 0, size => 16 },
85   "timestamp",
86   {
87     data_type => "timestamp",
88     datetime_undef_if_invalid => 1,
89     default_value => \"current_timestamp",
90     is_nullable => 0,
91   },
92 );
93
94 =head1 PRIMARY KEY
95
96 =over 4
97
98 =item * L</renewal_id>
99
100 =back
101
102 =cut
103
104 __PACKAGE__->set_primary_key("renewal_id");
105
106 =head1 RELATIONS
107
108 =head2 renewer
109
110 Type: belongs_to
111
112 Related object: L<Koha::Schema::Result::Borrower>
113
114 =cut
115
116 __PACKAGE__->belongs_to(
117   "renewer",
118   "Koha::Schema::Result::Borrower",
119   { borrowernumber => "renewer_id" },
120   {
121     is_deferrable => 1,
122     join_type     => "LEFT",
123     on_delete     => "SET NULL",
124     on_update     => "CASCADE",
125   },
126 );
127
128
129 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-04-27 19:43:17
130 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7mjiEx634L5FZyjroACUkg
131
132 =head2 checkout
133
134 Type: belongs_to
135
136 Related object: L<Koha::Schema::Result::Issue>
137
138 =cut
139
140 __PACKAGE__->belongs_to(
141     "checkout",
142     "Koha::Schema::Result::Issue",
143     { issue_id => "checkout_id" },
144     {
145         is_deferrable => 1,
146         join_type     => "LEFT",
147     },
148 );
149
150 =head2 old_checkout
151
152 Type: belongs_to
153
154 Related object: L<Koha::Schema::Result::OldIssue>
155
156 =cut
157
158 __PACKAGE__->belongs_to(
159     "old_checkout",
160     "Koha::Schema::Result::OldIssue",
161     { issue_id => "checkout_id" },
162     {
163         is_deferrable => 1,
164         join_type     => "LEFT",
165     },
166 );
167
168 __PACKAGE__->add_columns(
169     '+seen' => { is_boolean => 1 }
170 );
171
172 sub koha_objects_class {
173     'Koha::Checkouts::Renewals';
174 }
175 sub koha_object_class {
176     'Koha::Checkouts::Renewal';
177 }
178
179 1;