Bugzilla – Attachment 159487 Details for
Bug 35471
Automatically select child MARC framework when adding child records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35471: DBIx changes
Bug-35471-DBIx-changes.patch (text/plain), 2.46 KB, created by
Lari Taskula
on 2023-12-01 23:07:26 UTC
(
hide
)
Description:
Bug 35471: DBIx changes
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2023-12-01 23:07:26 UTC
Size:
2.46 KB
patch
obsolete
>From 5915ddee0ad8e386ba72d30ca7f7b6bc01ca82b5 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Fri, 1 Dec 2023 16:30:15 +0000 >Subject: [PATCH] Bug 35471: DBIx changes > >Sponsored-by: Hypernova Oy >--- > Koha/Schema/Result/BiblioFramework.pm | 50 +++++++++++++++++++++++++-- > 1 file changed, 48 insertions(+), 2 deletions(-) > >diff --git a/Koha/Schema/Result/BiblioFramework.pm b/Koha/Schema/Result/BiblioFramework.pm >index 15755315d2..c865f6ad74 100644 >--- a/Koha/Schema/Result/BiblioFramework.pm >+++ b/Koha/Schema/Result/BiblioFramework.pm >@@ -32,6 +32,13 @@ __PACKAGE__->table("biblio_framework"); > > the unique code assigned to the framework > >+=head2 parent_frameworkcode >+ >+ data_type: 'varchar' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ size: 4 >+ > =head2 frameworktext > > data_type: 'varchar' >@@ -46,6 +53,8 @@ the description/name given to the framework > __PACKAGE__->add_columns( > "frameworkcode", > { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 }, >+ "parent_frameworkcode", >+ { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 4 }, > "frameworktext", > { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, > ); >@@ -62,9 +71,46 @@ __PACKAGE__->add_columns( > > __PACKAGE__->set_primary_key("frameworkcode"); > >+=head1 RELATIONS >+ >+=head2 biblio_frameworks >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::BiblioFramework> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "biblio_frameworks", >+ "Koha::Schema::Result::BiblioFramework", >+ { "foreign.parent_frameworkcode" => "self.frameworkcode" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+=head2 parent_frameworkcode >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::BiblioFramework> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "parent_frameworkcode", >+ "Koha::Schema::Result::BiblioFramework", >+ { frameworkcode => "parent_frameworkcode" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YdCNaeY5v1WcfcDuA6xE0w >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-12-01 16:19:52 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ac+E/s6Yov29CJKDGovgNw > > # FIXME This should not be needed, we need to add the FK at DB level > # It cannot be done now because the default framework (frameworkcode=='') >-- >2.34.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 35471
:
159486
|
159487
|
159488
|
159489
|
159490
|
159491
|
159492
|
159493
|
159494
|
159495
|
159496
|
159497
|
159498
|
159499
|
159500
|
159567
|
159568
|
159569
|
159570
|
159571
|
159572
|
159573
|
159884