Bugzilla – Attachment 133971 Details for
Bug 30275
Checkout renewals should be stored in their own table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30275: DBIC Schema Changes
Bug-30275-DBIC-Schema-Changes.patch (text/plain), 3.77 KB, created by
Owen Leonard
on 2022-04-26 17:02:15 UTC
(
hide
)
Description:
Bug 30275: DBIC Schema Changes
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-04-26 17:02:15 UTC
Size:
3.77 KB
patch
obsolete
>From 05cb0ab6e1b71f49dd71819950d7fe708588d3e5 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 11 Mar 2022 13:07:59 +0000 >Subject: [PATCH] Bug 30275: DBIC Schema Changes > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > Koha/Schema/Result/Borrower.pm | 15 +++ > Koha/Schema/Result/CheckoutRenewal.pm | 134 ++++++++++++++++++++++++++ > 2 files changed, 149 insertions(+) > create mode 100644 Koha/Schema/Result/CheckoutRenewal.pm > >diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm >index 175710d0f5..93948c8700 100644 >--- a/Koha/Schema/Result/Borrower.pm >+++ b/Koha/Schema/Result/Borrower.pm >@@ -1164,6 +1164,21 @@ __PACKAGE__->belongs_to( > { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, > ); > >+=head2 checkout_renewals >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::CheckoutRenewal> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "checkout_renewals", >+ "Koha::Schema::Result::CheckoutRenewal", >+ { "foreign.renewer_id" => "self.borrowernumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 club_enrollments > > Type: has_many >diff --git a/Koha/Schema/Result/CheckoutRenewal.pm b/Koha/Schema/Result/CheckoutRenewal.pm >new file mode 100644 >index 0000000000..6963927e9a >--- /dev/null >+++ b/Koha/Schema/Result/CheckoutRenewal.pm >@@ -0,0 +1,134 @@ >+use utf8; >+package Koha::Schema::Result::CheckoutRenewal; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::CheckoutRenewal >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<checkout_renewals> >+ >+=cut >+ >+__PACKAGE__->table("checkout_renewals"); >+ >+=head1 ACCESSORS >+ >+=head2 id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ >+=head2 issue_id >+ >+ data_type: 'integer' >+ is_nullable: 1 >+ >+the id of the issue this renewal pertains to >+ >+=head2 renewer_id >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ >+the id of the user who processed the renewal >+ >+=head2 seen >+ >+ data_type: 'tinyint' >+ default_value: 0 >+ is_nullable: 1 >+ >+boolean denoting whether the item was present or not >+ >+=head2 interface >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 16 >+ >+the interface this renewal took place on >+ >+=head2 timestamp >+ >+ data_type: 'timestamp' >+ datetime_undef_if_invalid: 1 >+ default_value: current_timestamp >+ is_nullable: 0 >+ >+the date and time the renewal took place >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >+ "issue_id", >+ { data_type => "integer", is_nullable => 1 }, >+ "renewer_id", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >+ "seen", >+ { data_type => "tinyint", default_value => 0, is_nullable => 1 }, >+ "interface", >+ { data_type => "varchar", is_nullable => 0, size => 16 }, >+ "timestamp", >+ { >+ data_type => "timestamp", >+ datetime_undef_if_invalid => 1, >+ default_value => \"current_timestamp", >+ is_nullable => 0, >+ }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("id"); >+ >+=head1 RELATIONS >+ >+=head2 renewer >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Borrower> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "renewer", >+ "Koha::Schema::Result::Borrower", >+ { borrowernumber => "renewer_id" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-03-11 16:33:50 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:agLgLnVeKYB5wdWS06xD0A >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30275
:
131593
|
131594
|
131595
|
131596
|
131597
|
131598
|
131599
|
131600
|
131601
|
131602
|
131603
|
131604
|
131605
|
131606
|
131607
|
131608
|
131609
|
131610
|
131611
|
131612
|
131613
|
131614
|
131615
|
131616
|
131879
|
131880
|
131881
|
131882
|
131883
|
131884
|
131885
|
131886
|
131887
|
131888
|
131889
|
131890
|
131897
|
131898
|
131899
|
131900
|
131901
|
131902
|
131903
|
131904
|
131905
|
131906
|
131907
|
131908
|
131909
|
131910
|
133908
|
133909
|
133910
|
133911
|
133912
|
133913
|
133914
|
133915
|
133916
|
133917
|
133918
|
133919
|
133920
|
133921
|
133922
|
133929
|
133930
|
133931
|
133932
|
133933
|
133934
|
133935
|
133936
|
133937
|
133938
|
133939
|
133940
|
133941
|
133942
|
133943
|
133944
|
133969
|
133970
|
133971
|
133972
|
133973
|
133974
|
133975
|
133976
|
133977
|
133978
|
133979
|
133980
|
133981
|
133982
|
133983
|
133984
|
134177
|
134178
|
134179
|
134180
|
134181
|
134182
|
134183
|
134184
|
134185
|
134186
|
134187
|
134188
|
134189
|
134190
|
134191
|
134192
|
134193
|
134210
|
134228
|
134229
|
134230
|
134231
|
134232
|
134233
|
134234
|
134235
|
134236
|
134237
|
134238
|
134239
|
134240
|
134241
|
134242
|
134243
|
134244
|
134245
|
134246
|
134247
|
134248
|
134470
|
134471
|
134472
|
134473
|
134869
|
134870
|
134871
|
134872
|
134873
|
134874
|
134875
|
134876
|
134877
|
134878
|
134879
|
134880
|
134881
|
134882
|
134883
|
134884
|
134885
|
134886
|
134887
|
134888
|
134889
|
135123
|
135124
|
135125
|
135126
|
135127
|
135128
|
135129
|
135130
|
135131
|
135132
|
135133
|
135134
|
135135
|
135136
|
135137
|
135138
|
135139
|
135140
|
135141
|
135142
|
135143
|
137146
|
137147
|
137148
|
137149
|
137150
|
137151
|
137152
|
137153
|
137154
|
137155
|
137156
|
137157
|
137158
|
137159
|
137160
|
137161
|
137162
|
137163
|
137164
|
137165
|
137166
|
137217
|
137598