View | Details | Raw Unified | Return to bug 38924
Collapse All | Expand All

(-)a/Koha/Schema/Result/Borrower.pm (-2 / +32 lines)
Lines 1721-1726 __PACKAGE__->has_many( Link Here
1721
  { cascade_copy => 0, cascade_delete => 0 },
1721
  { cascade_copy => 0, cascade_delete => 0 },
1722
);
1722
);
1723
1723
1724
=head2 patron_quota_usages
1725
1726
Type: has_many
1727
1728
Related object: L<Koha::Schema::Result::PatronQuotaUsage>
1729
1730
=cut
1731
1732
__PACKAGE__->has_many(
1733
  "patron_quota_usages",
1734
  "Koha::Schema::Result::PatronQuotaUsage",
1735
  { "foreign.patron_id" => "self.borrowernumber" },
1736
  { cascade_copy => 0, cascade_delete => 0 },
1737
);
1738
1739
=head2 patron_quotas
1740
1741
Type: has_many
1742
1743
Related object: L<Koha::Schema::Result::PatronQuota>
1744
1745
=cut
1746
1747
__PACKAGE__->has_many(
1748
  "patron_quotas",
1749
  "Koha::Schema::Result::PatronQuota",
1750
  { "foreign.patron_id" => "self.borrowernumber" },
1751
  { cascade_copy => 0, cascade_delete => 0 },
1752
);
1753
1724
=head2 patronimage
1754
=head2 patronimage
1725
1755
1726
Type: might_have
1756
Type: might_have
Lines 2212-2219 Composing rels: L</user_permissions> -> permission Link Here
2212
__PACKAGE__->many_to_many("permissions", "user_permissions", "permission");
2242
__PACKAGE__->many_to_many("permissions", "user_permissions", "permission");
2213
2243
2214
2244
2215
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-10-29 16:44:27
2245
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-11-06 17:39:07
2216
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SSJcjPvlr82qecmbk1Q8iA
2246
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vB+lPQBN+56QCmNT0ARuLQ
2217
2247
2218
__PACKAGE__->belongs_to(
2248
__PACKAGE__->belongs_to(
2219
  "library",
2249
  "library",
(-)a/Koha/Schema/Result/PatronQuota.pm (+150 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::PatronQuota;
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::PatronQuota
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<patron_quota>
19
20
=cut
21
22
__PACKAGE__->table("patron_quota");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
unique identifier for the quota record
33
34
=head2 description
35
36
  data_type: 'longtext'
37
  is_nullable: 0
38
39
user friendly description for the quota record
40
41
=head2 patron_id
42
43
  data_type: 'integer'
44
  is_foreign_key: 1
45
  is_nullable: 0
46
47
foreign key linking to borrowers.borrowernumber
48
49
=head2 allocation
50
51
  data_type: 'integer'
52
  default_value: 0
53
  is_nullable: 0
54
55
total quota allocation for the period
56
57
=head2 used
58
59
  data_type: 'integer'
60
  default_value: 0
61
  is_nullable: 0
62
63
amount of allocation used for current period
64
65
=head2 start_date
66
67
  data_type: 'date'
68
  datetime_undef_if_invalid: 1
69
  is_nullable: 0
70
71
start date of the allocation period
72
73
=head2 end_date
74
75
  data_type: 'date'
76
  datetime_undef_if_invalid: 1
77
  is_nullable: 0
78
79
end date of the allocation period
80
81
=cut
82
83
__PACKAGE__->add_columns(
84
  "id",
85
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
86
  "description",
87
  { data_type => "longtext", is_nullable => 0 },
88
  "patron_id",
89
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
90
  "allocation",
91
  { data_type => "integer", default_value => 0, is_nullable => 0 },
92
  "used",
93
  { data_type => "integer", default_value => 0, is_nullable => 0 },
94
  "start_date",
95
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
96
  "end_date",
97
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
98
);
99
100
=head1 PRIMARY KEY
101
102
=over 4
103
104
=item * L</id>
105
106
=back
107
108
=cut
109
110
__PACKAGE__->set_primary_key("id");
111
112
=head1 RELATIONS
113
114
=head2 patron
115
116
Type: belongs_to
117
118
Related object: L<Koha::Schema::Result::Borrower>
119
120
=cut
121
122
__PACKAGE__->belongs_to(
123
  "patron",
124
  "Koha::Schema::Result::Borrower",
125
  { borrowernumber => "patron_id" },
126
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
127
);
128
129
=head2 patron_quota_usages
130
131
Type: has_many
132
133
Related object: L<Koha::Schema::Result::PatronQuotaUsage>
134
135
=cut
136
137
__PACKAGE__->has_many(
138
  "patron_quota_usages",
139
  "Koha::Schema::Result::PatronQuotaUsage",
140
  { "foreign.patron_quota_id" => "self.id" },
141
  { cascade_copy => 0, cascade_delete => 0 },
142
);
143
144
145
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-01-30 16:04:36
146
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KG/MIjPSLcpeSlPypwli2Q
147
148
149
# You can replace this text with custom code or comments, and it will be preserved on regeneration
150
1;
(-)a/Koha/Schema/Result/PatronQuotaUsage.pm (-1 / +150 lines)
Line 0 Link Here
0
- 
1
use utf8;
2
package Koha::Schema::Result::PatronQuotaUsage;
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::PatronQuotaUsage
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<patron_quota_usage>
19
20
=cut
21
22
__PACKAGE__->table("patron_quota_usage");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
unique identifier for quota usage record
33
34
=head2 patron_quota_id
35
36
  data_type: 'integer'
37
  is_foreign_key: 1
38
  is_nullable: 0
39
40
foreign key linking to patron_quota.id
41
42
=head2 issue_id
43
44
  data_type: 'integer'
45
  is_nullable: 1
46
47
linking to issues.issue_id or old_issues.issue_id
48
49
=head2 patron_id
50
51
  data_type: 'integer'
52
  is_foreign_key: 1
53
  is_nullable: 0
54
55
foreign key linking to borrowers.borrowernumber
56
57
=head2 type
58
59
  data_type: 'enum'
60
  extra: {list => ["ISSUE","RENEW"]}
61
  is_nullable: 0
62
63
The type of usage this is
64
65
=head2 creation_date
66
67
  data_type: 'timestamp'
68
  datetime_undef_if_invalid: 1
69
  default_value: current_timestamp
70
  is_nullable: 0
71
72
the timestamp for when a usage was recorded
73
74
=cut
75
76
__PACKAGE__->add_columns(
77
  "id",
78
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
79
  "patron_quota_id",
80
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
81
  "issue_id",
82
  { data_type => "integer", is_nullable => 1 },
83
  "patron_id",
84
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
85
  "type",
86
  {
87
    data_type => "enum",
88
    extra => { list => ["ISSUE", "RENEW"] },
89
    is_nullable => 0,
90
  },
91
  "creation_date",
92
  {
93
    data_type => "timestamp",
94
    datetime_undef_if_invalid => 1,
95
    default_value => \"current_timestamp",
96
    is_nullable => 0,
97
  },
98
);
99
100
=head1 PRIMARY KEY
101
102
=over 4
103
104
=item * L</id>
105
106
=back
107
108
=cut
109
110
__PACKAGE__->set_primary_key("id");
111
112
=head1 RELATIONS
113
114
=head2 patron
115
116
Type: belongs_to
117
118
Related object: L<Koha::Schema::Result::Borrower>
119
120
=cut
121
122
__PACKAGE__->belongs_to(
123
  "patron",
124
  "Koha::Schema::Result::Borrower",
125
  { borrowernumber => "patron_id" },
126
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
127
);
128
129
=head2 patron_quota
130
131
Type: belongs_to
132
133
Related object: L<Koha::Schema::Result::PatronQuota>
134
135
=cut
136
137
__PACKAGE__->belongs_to(
138
  "patron_quota",
139
  "Koha::Schema::Result::PatronQuota",
140
  { id => "patron_quota_id" },
141
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
142
);
143
144
145
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-11-06 17:47:10
146
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hxeHkoIaFwVoiLReL04/4A
147
148
149
# You can replace this text with custom code or comments, and it will be preserved on regeneration
150
1;

Return to bug 38924