Bugzilla – Attachment 126104 Details for
Bug 28854
Add ability to create bundles of items for circulation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28854: DBIC Schema Updates
Bug-28854-DBIC-Schema-Updates.patch (text/plain), 7.86 KB, created by
Martin Renvoize (ashimema)
on 2021-10-12 15:51:26 UTC
(
hide
)
Description:
Bug 28854: DBIC Schema Updates
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-10-12 15:51:26 UTC
Size:
7.86 KB
patch
obsolete
>From bbe0065a1b245e87c420350eb43dfffc6d4e2229 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 23 Sep 2021 08:33:26 +0100 >Subject: [PATCH] Bug 28854: DBIC Schema Updates > >--- > Koha/Schema/Result/Item.pm | 49 +++++++++- > Koha/Schema/Result/ItemBundle.pm | 113 ++++++++++++++++++++++ > Koha/Schema/Result/ItemsLostIssue.pm | 138 +++++++++++++++++++++++++++ > Koha/Schema/Result/OldIssue.pm | 19 +++- > 4 files changed, 315 insertions(+), 4 deletions(-) > create mode 100644 Koha/Schema/Result/ItemBundle.pm > create mode 100644 Koha/Schema/Result/ItemsLostIssue.pm > >diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm >index a53e10e98a..316203cea0 100644 >--- a/Koha/Schema/Result/Item.pm >+++ b/Koha/Schema/Result/Item.pm >@@ -729,6 +729,36 @@ __PACKAGE__->might_have( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 item_bundles_hosts >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::ItemBundle> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "item_bundles_hosts", >+ "Koha::Schema::Result::ItemBundle", >+ { "foreign.host" => "self.itemnumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+=head2 item_bundles_item >+ >+Type: might_have >+ >+Related object: L<Koha::Schema::Result::ItemBundle> >+ >+=cut >+ >+__PACKAGE__->might_have( >+ "item_bundles_item", >+ "Koha::Schema::Result::ItemBundle", >+ { "foreign.item" => "self.itemnumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 items_last_borrower > > Type: might_have >@@ -744,6 +774,21 @@ __PACKAGE__->might_have( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 items_lost_issue >+ >+Type: might_have >+ >+Related object: L<Koha::Schema::Result::ItemsLostIssue> >+ >+=cut >+ >+__PACKAGE__->might_have( >+ "items_lost_issue", >+ "Koha::Schema::Result::ItemsLostIssue", >+ { "foreign.itemnumber" => "self.itemnumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 linktrackers > > Type: has_many >@@ -865,8 +910,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-27 08:42:21 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SjZn3haOtUZWu1jrMigjNQ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-23 07:00:41 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/LUKEnOVCeXHPYDqV7HGRg > > __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); > >diff --git a/Koha/Schema/Result/ItemBundle.pm b/Koha/Schema/Result/ItemBundle.pm >new file mode 100644 >index 0000000000..590061c922 >--- /dev/null >+++ b/Koha/Schema/Result/ItemBundle.pm >@@ -0,0 +1,113 @@ >+use utf8; >+package Koha::Schema::Result::ItemBundle; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::ItemBundle >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<item_bundles> >+ >+=cut >+ >+__PACKAGE__->table("item_bundles"); >+ >+=head1 ACCESSORS >+ >+=head2 item >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 0 >+ >+=head2 host >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 0 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "item", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, >+ "host", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</host> >+ >+=item * L</item> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("host", "item"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<item_bundles_uniq_1> >+ >+=over 4 >+ >+=item * L</item> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint("item_bundles_uniq_1", ["item"]); >+ >+=head1 RELATIONS >+ >+=head2 host >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Item> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "host", >+ "Koha::Schema::Result::Item", >+ { itemnumber => "host" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+=head2 item >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Item> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "item", >+ "Koha::Schema::Result::Item", >+ { itemnumber => "item" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-10 13:47:56 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QXlgF8iwZUFSsg+Eo5kNUw >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >diff --git a/Koha/Schema/Result/ItemsLostIssue.pm b/Koha/Schema/Result/ItemsLostIssue.pm >new file mode 100644 >index 0000000000..6d213d9ee4 >--- /dev/null >+++ b/Koha/Schema/Result/ItemsLostIssue.pm >@@ -0,0 +1,138 @@ >+use utf8; >+package Koha::Schema::Result::ItemsLostIssue; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::ItemsLostIssue >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<items_lost_issue> >+ >+=cut >+ >+__PACKAGE__->table("items_lost_issue"); >+ >+=head1 ACCESSORS >+ >+=head2 id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ >+=head2 itemnumber >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 0 >+ >+=head2 issue_id >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ >+=head2 created_on >+ >+ data_type: 'timestamp' >+ datetime_undef_if_invalid: 1 >+ default_value: current_timestamp >+ is_nullable: 0 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >+ "itemnumber", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, >+ "issue_id", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >+ "created_on", >+ { >+ 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 UNIQUE CONSTRAINTS >+ >+=head2 C<itemnumber> >+ >+=over 4 >+ >+=item * L</itemnumber> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint("itemnumber", ["itemnumber"]); >+ >+=head1 RELATIONS >+ >+=head2 issue >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::OldIssue> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "issue", >+ "Koha::Schema::Result::OldIssue", >+ { issue_id => "issue_id" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ >+=head2 itemnumber >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Item> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "itemnumber", >+ "Koha::Schema::Result::Item", >+ { itemnumber => "itemnumber" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-23 07:00:41 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8QBruozDPiIGKamb3U2Wxw >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >diff --git a/Koha/Schema/Result/OldIssue.pm b/Koha/Schema/Result/OldIssue.pm >index 7d37600caf..a3c5d090c7 100644 >--- a/Koha/Schema/Result/OldIssue.pm >+++ b/Koha/Schema/Result/OldIssue.pm >@@ -305,9 +305,24 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 items_lost_issues > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BWwXBAuls9a0HhscR0WlGQ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::ItemsLostIssue> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "items_lost_issues", >+ "Koha::Schema::Result::ItemsLostIssue", >+ { "foreign.issue_id" => "self.issue_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-23 07:00:41 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RYZFozdomZ0NrvimL6+YZQ > > __PACKAGE__->add_columns( > '+auto_renew' => { is_boolean => 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 28854
:
124319
|
124498
|
124616
|
125200
|
125201
|
125202
|
125203
|
125204
|
125205
|
125206
|
126103
|
126104
|
126105
|
126106
|
126107
|
126108
|
126109
|
126110
|
126148
|
126149
|
126150
|
126151
|
126152
|
126153
|
126154
|
126155
|
126166
|
126167
|
126168
|
126169
|
126170
|
126171
|
126172
|
126173
|
127498
|
127499
|
127500
|
127501
|
127502
|
127503
|
127504
|
127505
|
127659
|
127660
|
127661
|
127662
|
127663
|
127664
|
127665
|
127666
|
127829
|
127830
|
127831
|
127832
|
127833
|
127834
|
127835
|
127836
|
127837
|
127838
|
130313
|
130314
|
130315
|
130316
|
130317
|
130318
|
130319
|
130320
|
130321
|
130322
|
130323
|
130324
|
130325
|
130326
|
130327
|
130328
|
130329
|
130330
|
130331
|
130332
|
130456
|
132703
|
132704
|
132705
|
132706
|
132707
|
132708
|
132709
|
132710
|
132711
|
132712
|
132713
|
132714
|
132715
|
132716
|
132717
|
132718
|
132719
|
132720
|
132721
|
132722
|
132723
|
135019
|
135020
|
135021
|
135022
|
135023
|
135024
|
135025
|
135026
|
135027
|
135028
|
135029
|
135030
|
135031
|
135032
|
135033
|
135034
|
135035
|
135036
|
135037
|
136226
|
136227
|
136228
|
136229
|
136230
|
136231
|
136232
|
136233
|
136234
|
136235
|
136236
|
136237
|
136238
|
136239
|
136240
|
136241
|
136242
|
136243
|
136244
|
136249
|
136253
|
136254
|
136264
|
136265
|
136266
|
136267
|
136268
|
136269
|
136270
|
136271
|
136272
|
136273
|
136274
|
136275
|
136276
|
136277
|
136278
|
136279
|
136280
|
136281
|
136282
|
136283
|
136284
|
136285
|
136287
|
136340
|
136341
|
136342
|
136343
|
136344
|
136345
|
136346
|
136347
|
136348
|
136349
|
136350
|
136351
|
136352
|
136353
|
136354
|
136355
|
136356
|
136357
|
136358
|
136359
|
136360
|
136361
|
136362
|
136363
|
136364
|
136365
|
136366
|
136367
|
136368
|
136369
|
136370
|
136371
|
136498
|
136529
|
136530
|
136613
|
136614
|
136615
|
136616
|
136617
|
136618
|
136619
|
136620
|
136621
|
136622
|
136623
|
136624
|
136625
|
136626
|
136627
|
136628
|
136629
|
136630
|
136631
|
136632
|
136633
|
136634
|
136635
|
136636
|
136637
|
136638
|
136639
|
136640
|
136641
|
136642
|
136643
|
136644
|
136645
|
136646
|
136647
|
136648
|
136649
|
136650
|
136651
|
136652
|
136654
|
136655
|
136806
|
136809
|
136811
|
136814
|
136817
|
136821
|
136824
|
136826
|
136829
|
136832
|
136835
|
136838
|
136841
|
136843
|
136846
|
136849
|
136850
|
136851
|
136852
|
136853
|
136854
|
136855
|
136856
|
136857
|
136858
|
136859
|
136860
|
136861
|
136862
|
136863
|
136864
|
136865
|
136866
|
136867
|
136868
|
136869
|
136870
|
136871
|
136872
|
136873
|
136874
|
136875
|
136876
|
136877
|
136905
|
136906
|
136907
|
136908
|
136909
|
136910
|
136911
|
136912
|
136913
|
136914
|
136915
|
136916
|
136917
|
136918
|
136919
|
136920
|
136921
|
136922
|
136923
|
136924
|
136925
|
136926
|
136927
|
136928
|
136929
|
136930
|
136931
|
136932
|
136933
|
136934
|
136935
|
136936
|
136937
|
136938
|
136939
|
136940
|
136941
|
136942
|
136943
|
136944
|
136945
|
136946
|
136947
|
136949
|
136978
|
136979
|
136980
|
136981
|
136982
|
136985
|
136988
|
136989
|
136990
|
136991
|
136992
|
136993
|
136994
|
136995
|
136996
|
136997
|
136998
|
136999
|
137000
|
137001
|
137002
|
137003
|
137004
|
137005
|
137006
|
137007
|
137008
|
137009
|
137010
|
137011
|
137012
|
137013
|
137014
|
137015
|
137016
|
137017
|
137018
|
137019
|
137020
|
137021
|
137022
|
137461
|
137462
|
137463
|
137464
|
137465
|
137466
|
137467
|
137468
|
137469
|
137470
|
137471
|
137472
|
137473
|
137474
|
137475
|
137476
|
137477
|
137478
|
137479
|
137480
|
137481
|
137482
|
137483
|
137484
|
137485
|
137486
|
137487
|
137488
|
137489
|
137490
|
137491
|
137492
|
137493
|
137494
|
137495
|
137496
|
137497
|
137498
|
137499
|
137500
|
137501
|
137503
|
137506
|
137524
|
137525
|
137527
|
137528
|
137529
|
137530
|
137531
|
137532
|
137533
|
137534
|
137535
|
137536
|
137537
|
137538
|
137540
|
137541
|
137542
|
137543
|
137544
|
137545
|
137546
|
137547
|
137548
|
137549
|
137550
|
137551
|
137552
|
137553
|
137554
|
137555
|
137556
|
137557
|
137558
|
137559
|
137560
|
137561
|
137562
|
137563
|
137564
|
137565
|
137566
|
137567
|
137568
|
137569
|
137570
|
137571
|
137684
|
137685
|
139347