Bug 34587: Remove counter files from API embedding to improve performance
[koha.git] / Koha / Schema / Result / ErmCounterLog.pm
1 use utf8;
2 package Koha::Schema::Result::ErmCounterLog;
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::ErmCounterLog
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<erm_counter_logs>
19
20 =cut
21
22 __PACKAGE__->table("erm_counter_logs");
23
24 =head1 ACCESSORS
25
26 =head2 erm_counter_log_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 primary key
33
34 =head2 borrowernumber
35
36   data_type: 'integer'
37   is_foreign_key: 1
38   is_nullable: 1
39
40 foreign key to borrowers
41
42 =head2 counter_files_id
43
44   data_type: 'integer'
45   is_foreign_key: 1
46   is_nullable: 1
47
48 foreign key to erm_counter_files
49
50 =head2 usage_data_provider_id
51
52   data_type: 'integer'
53   is_foreign_key: 1
54   is_nullable: 1
55
56 foreign key to erm_usage_data_providers
57
58 =head2 importdate
59
60   data_type: 'timestamp'
61   datetime_undef_if_invalid: 1
62   default_value: current_timestamp
63   is_nullable: 0
64
65 counter file import date
66
67 =head2 filename
68
69   data_type: 'varchar'
70   is_nullable: 1
71   size: 80
72
73 name of the counter file
74
75 =head2 logdetails
76
77   data_type: 'longtext'
78   is_nullable: 1
79
80 details from the counter log
81
82 =cut
83
84 __PACKAGE__->add_columns(
85   "erm_counter_log_id",
86   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
87   "borrowernumber",
88   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
89   "counter_files_id",
90   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
91   "usage_data_provider_id",
92   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
93   "importdate",
94   {
95     data_type => "timestamp",
96     datetime_undef_if_invalid => 1,
97     default_value => \"current_timestamp",
98     is_nullable => 0,
99   },
100   "filename",
101   { data_type => "varchar", is_nullable => 1, size => 80 },
102   "logdetails",
103   { data_type => "longtext", is_nullable => 1 },
104 );
105
106 =head1 PRIMARY KEY
107
108 =over 4
109
110 =item * L</erm_counter_log_id>
111
112 =back
113
114 =cut
115
116 __PACKAGE__->set_primary_key("erm_counter_log_id");
117
118 =head1 RELATIONS
119
120 =head2 borrowernumber
121
122 Type: belongs_to
123
124 Related object: L<Koha::Schema::Result::Borrower>
125
126 =cut
127
128 __PACKAGE__->belongs_to(
129   "borrowernumber",
130   "Koha::Schema::Result::Borrower",
131   { borrowernumber => "borrowernumber" },
132   {
133     is_deferrable => 1,
134     join_type     => "LEFT",
135     on_delete     => "CASCADE",
136     on_update     => "CASCADE",
137   },
138 );
139
140 =head2 counter_file
141
142 Type: belongs_to
143
144 Related object: L<Koha::Schema::Result::ErmCounterFile>
145
146 =cut
147
148 __PACKAGE__->belongs_to(
149   "counter_file",
150   "Koha::Schema::Result::ErmCounterFile",
151   { erm_counter_files_id => "counter_files_id" },
152   {
153     is_deferrable => 1,
154     join_type     => "LEFT",
155     on_delete     => "CASCADE",
156     on_update     => "CASCADE",
157   },
158 );
159
160 =head2 usage_data_provider
161
162 Type: belongs_to
163
164 Related object: L<Koha::Schema::Result::ErmUsageDataProvider>
165
166 =cut
167
168 __PACKAGE__->belongs_to(
169   "usage_data_provider",
170   "Koha::Schema::Result::ErmUsageDataProvider",
171   { erm_usage_data_provider_id => "usage_data_provider_id" },
172   {
173     is_deferrable => 1,
174     join_type     => "LEFT",
175     on_delete     => "CASCADE",
176     on_update     => "CASCADE",
177   },
178 );
179
180
181 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-10-11 10:09:06
182 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5tmoa4Our5qmolU0OWXjcQ
183
184
185 sub koha_object_class {
186     'Koha::ERM::EUsage::CounterLog';
187 }
188 sub koha_objects_class {
189     'Koha::ERM::EUsage::CounterLogs';
190 }
191 1;