Bugzilla – Attachment 86661 Details for
Bug 22008
accountlines.manager_id is missing a foreign key constraint
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22008: Fixes to make unit tests pass
Bug-22008-Fixes-to-make-unit-tests-pass.patch (text/plain), 2.55 KB, created by
Josef Moravec
on 2019-03-15 10:08:27 UTC
(
hide
)
Description:
Bug 22008: Fixes to make unit tests pass
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-03-15 10:08:27 UTC
Size:
2.55 KB
patch
obsolete
>From 881d23c2a48becd055d5ccb0148d236e4e8b556d Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 6 Mar 2019 08:08:19 -0500 >Subject: [PATCH] Bug 22008: Fixes to make unit tests pass > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > installer/data/mysql/atomicupdate/bug_22008.perl | 4 ++-- > t/db_dependent/Koha/Account/Lines.t | 3 ++- > 2 files changed, 4 insertions(+), 3 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_22008.perl b/installer/data/mysql/atomicupdate/bug_22008.perl >index 7f6098e65e..8a398bb25d 100644 >--- a/installer/data/mysql/atomicupdate/bug_22008.perl >+++ b/installer/data/mysql/atomicupdate/bug_22008.perl >@@ -3,8 +3,8 @@ if( CheckVersion( $DBversion ) ) { > > # Add constraint for manager_id > unless( foreign_key_exists( 'accountlines', 'accountlines_ibfk_borrowers_2' ) ) { >- $dbh->do("ALTER TABLE accountlines CHANGE COLUMN manager_id manager_id INT(11) NULL DEFAULT NULL;"); >- $dbh->do("UPDATE accountlines a LEFT JOIN borrowers b ON ( a.manager_id = b.borrowernumber) SET a.manager_id = NULL WHERE b.borrowernumber IS NULL; >+ $dbh->do("ALTER TABLE accountlines CHANGE COLUMN manager_id manager_id INT(11) NULL DEFAULT NULL"); >+ $dbh->do("UPDATE accountlines a LEFT JOIN borrowers b ON ( a.manager_id = b.borrowernumber) SET a.manager_id = NULL WHERE b.borrowernumber IS NULL"); > $dbh->do("ALTER TABLE accountlines ADD CONSTRAINT `accountlines_ibfk_borrowers_2` FOREIGN KEY (`manager_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE"); > } > >diff --git a/t/db_dependent/Koha/Account/Lines.t b/t/db_dependent/Koha/Account/Lines.t >index bf5634a349..aafda5f43d 100755 >--- a/t/db_dependent/Koha/Account/Lines.t >+++ b/t/db_dependent/Koha/Account/Lines.t >@@ -285,7 +285,7 @@ subtest 'Keep account info when related patron, staff or item is deleted' => sub > my $item = $builder->build_object({ class => 'Koha::Items' }); > my $issue = $builder->build_object( > { >- class => 'Koha::Checkout', >+ class => 'Koha::Checkouts', > value => { itemnumber => $item->itemnumber } > } > ); >@@ -298,6 +298,7 @@ subtest 'Keep account info when related patron, staff or item is deleted' => sub > amount => 10, > })->store; > >+ $issue->delete; > $item->delete; > $line = $line->get_from_storage; > is( $line->itemnumber, undef, "The account line should not be deleted when the related item is delete"); >-- >2.11.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 22008
:
83278
|
83280
|
83460
|
83461
|
83462
|
85267
|
85268
|
85613
|
85614
|
85767
|
85768
|
86162
|
86163
|
86164
|
86659
|
86660
| 86661 |
86994
|
86995
|
87066
|
87072