Bugzilla – Attachment 162248 Details for
Bug 22421
accountlines.issue_id is missing a foreign key constraint
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22421: Schema Update
Bug-22421-Schema-Update.patch (text/plain), 4.62 KB, created by
Victor Grousset/tuxayo
on 2024-02-16 20:49:06 UTC
(
hide
)
Description:
Bug 22421: Schema Update
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2024-02-16 20:49:06 UTC
Size:
4.62 KB
patch
obsolete
>From bcf56760bbcf369d5112397e70a7d198bc17d042 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 8 Feb 2024 14:18:31 +0000 >Subject: [PATCH] Bug 22421: Schema Update > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > Koha/Schema/Result/Accountline.pm | 55 +++++++++++++++++++++++++++++-- > Koha/Schema/Result/Issue.pm | 19 +++++++++-- > Koha/Schema/Result/OldIssue.pm | 19 +++++++++-- > 3 files changed, 86 insertions(+), 7 deletions(-) > >diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm >index d1ba673cf2..1903a552ec 100644 >--- a/Koha/Schema/Result/Accountline.pm >+++ b/Koha/Schema/Result/Accountline.pm >@@ -32,6 +32,13 @@ __PACKAGE__->table("accountlines"); > =head2 issue_id > > data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ >+=head2 old_issue_id >+ >+ data_type: 'integer' >+ is_foreign_key: 1 > is_nullable: 1 > > =head2 borrowernumber >@@ -150,7 +157,9 @@ __PACKAGE__->add_columns( > "accountlines_id", > { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, > "issue_id", >- { data_type => "integer", is_nullable => 1 }, >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >+ "old_issue_id", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "borrowernumber", > { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "itemnumber", >@@ -335,6 +344,26 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 issue >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Issue> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "issue", >+ "Koha::Schema::Result::Issue", >+ { issue_id => "issue_id" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ > =head2 itemnumber > > Type: belongs_to >@@ -375,6 +404,26 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 old_issue >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::OldIssue> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "old_issue", >+ "Koha::Schema::Result::OldIssue", >+ { issue_id => "old_issue_id" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ > =head2 register > > Type: belongs_to >@@ -396,8 +445,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-01-28 20:21:02 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PjQR7oUkefiDt+eV69jZ3A >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2024-02-08 14:18:03 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aVLdvK1lek01lZ0mbaCwZQ > > =head2 patron > >diff --git a/Koha/Schema/Result/Issue.pm b/Koha/Schema/Result/Issue.pm >index 05fde17f46..ca46153e29 100644 >--- a/Koha/Schema/Result/Issue.pm >+++ b/Koha/Schema/Result/Issue.pm >@@ -260,6 +260,21 @@ __PACKAGE__->add_unique_constraint("itemnumber", ["itemnumber"]); > > =head1 RELATIONS > >+=head2 accountlines >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Accountline> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "accountlines", >+ "Koha::Schema::Result::Accountline", >+ { "foreign.issue_id" => "self.issue_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 borrowernumber > > Type: belongs_to >@@ -311,8 +326,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-09-12 11:34:50 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eNzDAKc3bmTLWeDu8u4nTQ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2024-02-08 14:18:03 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7VMPEayWBRQ9ga7uhQGR4w > > __PACKAGE__->add_columns( > '+auto_renew' => { is_boolean => 1 }, >diff --git a/Koha/Schema/Result/OldIssue.pm b/Koha/Schema/Result/OldIssue.pm >index 50ef4a82e0..de1a498af1 100644 >--- a/Koha/Schema/Result/OldIssue.pm >+++ b/Koha/Schema/Result/OldIssue.pm >@@ -245,6 +245,21 @@ __PACKAGE__->set_primary_key("issue_id"); > > =head1 RELATIONS > >+=head2 accountlines >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Accountline> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "accountlines", >+ "Koha::Schema::Result::Accountline", >+ { "foreign.old_issue_id" => "self.issue_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 borrowernumber > > Type: belongs_to >@@ -306,8 +321,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-03-18 12:35:21 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0XlDHyg8uB3oD9/jJtOxRg >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2024-02-08 14:18:03 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Pp1/8rwY5N9NBkgNCagvow > > __PACKAGE__->add_columns( > '+auto_renew' => { is_boolean => 1 }, >-- >2.43.2
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 22421
:
85773
|
85774
|
85775
|
90352
|
90353
|
90354
|
90359
|
90360
|
90361
|
90362
|
90365
|
90366
|
90367
|
90368
|
161919
|
161920
|
161921
|
161922
|
161923
|
162244
|
162245
|
162246
|
162247
|
162248
|
166631
|
173287
|
173288
|
173289
|
173305
|
173790
|
173791
|
173792
|
173793
|
173794
|
173795
|
173796
|
173797
|
173798
|
173799
|
174281