Bugzilla – Attachment 174181 Details for
Bug 38011
Add a foreign key link between vendors and subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38011: Schema update
Bug-38011-Schema-update.patch (text/plain), 3.11 KB, created by
Martin Renvoize (ashimema)
on 2024-11-07 12:10:22 UTC
(
hide
)
Description:
Bug 38011: Schema update
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-11-07 12:10:22 UTC
Size:
3.11 KB
patch
obsolete
>From ad55faf3a5afa471701646c5527f90be931e4a2e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 7 Nov 2024 11:33:30 +0000 >Subject: [PATCH] Bug 38011: Schema update > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Schema/Result/Aqbookseller.pm | 19 +++++++++++++++++-- > Koha/Schema/Result/Subscription.pm | 28 ++++++++++++++++++++++++---- > 2 files changed, 41 insertions(+), 6 deletions(-) > >diff --git a/Koha/Schema/Result/Aqbookseller.pm b/Koha/Schema/Result/Aqbookseller.pm >index f9ce48cae47..d1236a43b0b 100644 >--- a/Koha/Schema/Result/Aqbookseller.pm >+++ b/Koha/Schema/Result/Aqbookseller.pm >@@ -494,6 +494,21 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 subscriptions >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Subscription> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "subscriptions", >+ "Koha::Schema::Result::Subscription", >+ { "foreign.aqbooksellerid" => "self.id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 vendor_edi_accounts > > Type: has_many >@@ -510,8 +525,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-06-30 09:54:35 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xjeOqpcdN3Kb1wmLGDjzLg >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-11-07 11:31:56 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:E6f6AyKIiLOJ/rFkNTZcUw > > __PACKAGE__->add_columns( > '+active' => { is_boolean => 1 }, >diff --git a/Koha/Schema/Result/Subscription.pm b/Koha/Schema/Result/Subscription.pm >index cb5d1533f44..94f5cb8e441 100644 >--- a/Koha/Schema/Result/Subscription.pm >+++ b/Koha/Schema/Result/Subscription.pm >@@ -59,7 +59,7 @@ start date for this subscription > =head2 aqbooksellerid > > data_type: 'integer' >- default_value: 0 >+ is_foreign_key: 1 > is_nullable: 1 > > foreign key for aqbooksellers.id to link to the vendor >@@ -353,7 +353,7 @@ __PACKAGE__->add_columns( > "startdate", > { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, > "aqbooksellerid", >- { data_type => "integer", default_value => 0, is_nullable => 1 }, >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "cost", > { data_type => "integer", default_value => 0, is_nullable => 1 }, > "aqbudgetid", >@@ -450,6 +450,26 @@ __PACKAGE__->set_primary_key("subscriptionid"); > > =head1 RELATIONS > >+=head2 aqbooksellerid >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Aqbookseller> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "aqbooksellerid", >+ "Koha::Schema::Result::Aqbookseller", >+ { id => "aqbooksellerid" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ > =head2 aqorders > > Type: has_many >@@ -566,8 +586,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-07-14 11:46:15 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LICIiWzag365cUAq5OYD2A >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-11-07 11:31:56 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qd3CxnE91Zjvs8LXPEDV6Q > > __PACKAGE__->has_many( > "additional_field_values", >-- >2.47.0
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 38011
:
171971
|
171972
|
173859
|
173860
|
174180
|
174181
|
174182
|
174183
|
174185
|
174186
|
174187
|
174188
|
174397
|
174492