Bugzilla – Attachment 168814 Details for
Bug 18086
overduerules table is lacking foreign key constraints
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18086: Add categories to the db in tests
Bug-18086-Add-categories-to-the-db-in-tests.patch (text/plain), 3.27 KB, created by
Baptiste Wojtkowski (bwoj)
on 2024-07-11 13:07:22 UTC
(
hide
)
Description:
Bug 18086: Add categories to the db in tests
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2024-07-11 13:07:22 UTC
Size:
3.27 KB
patch
obsolete
>From d6e91cdda5d00f75a8059f4099ce93f0d54fe55a Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <bski@laposte.net> >Date: Thu, 11 Jul 2024 14:55:18 +0200 >Subject: [PATCH] Bug 18086: Add categories to the db in tests > >See https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18086#c27 >for more context : >This addresses the first point of this comment. > >Due to the constraint applied to categories, it is necessary that >categories exist in db so I create them >--- > t/db_dependent/Overdues.t | 56 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 56 insertions(+) > >diff --git a/t/db_dependent/Overdues.t b/t/db_dependent/Overdues.t >index 8faa056..a742cc9 100755 >--- a/t/db_dependent/Overdues.t >+++ b/t/db_dependent/Overdues.t >@@ -39,6 +39,62 @@ $dbh->do(q| > ('MPL', 'bar') > |); > >+my $samplecat = { >+ categorycode => 'PT', >+ description => 'Description1', >+ enrolmentperiod => undef, >+ enrolmentperioddate => undef, >+ dateofbirthrequired => undef, >+ finetype => undef, >+ bulk => undef, >+ enrolmentfee => undef, >+ overduenoticerequired => undef, >+ issuelimit => undef, >+ reservefee => undef, >+ hidelostitems => 0, >+ category_type => 'A', >+}; >+my $query = >+"INSERT INTO categories (categorycode,description,enrolmentperiod,enrolmentperioddate,dateofbirthrequired ,finetype,bulk,enrolmentfee,overduenoticerequired,issuelimit ,reservefee ,hidelostitems ,category_type) VALUES( ?,?,?,?,?,?,?,?,?,?,?,?,?)"; >+$dbh->do( >+ $query, {}, >+ $samplecat->{categorycode}, $samplecat->{description}, >+ $samplecat->{enrolmentperiod}, $samplecat->{enrolmentperioddate}, >+ $samplecat->{dateofbirthrequired}, $samplecat->{finetype}, >+ $samplecat->{bulk}, $samplecat->{enrolmentfee}, >+ $samplecat->{overduenoticerequired}, $samplecat->{issuelimit}, >+ $samplecat->{reservefee}, $samplecat->{hidelostitems}, >+ $samplecat->{category_type} >+); >+ >+my $samplecat2 = { >+ categorycode => 'YA', >+ description => 'Description1', >+ enrolmentperiod => undef, >+ enrolmentperioddate => undef, >+ dateofbirthrequired => undef, >+ finetype => undef, >+ bulk => undef, >+ enrolmentfee => undef, >+ overduenoticerequired => undef, >+ issuelimit => undef, >+ reservefee => undef, >+ hidelostitems => 0, >+ category_type => 'A', >+}; >+my $query2 = >+"INSERT INTO categories (categorycode,description,enrolmentperiod,enrolmentperioddate,dateofbirthrequired ,finetype,bulk,enrolmentfee,overduenoticerequired,issuelimit ,reservefee ,hidelostitems ,category_type) VALUES( ?,?,?,?,?,?,?,?,?,?,?,?,?)"; >+$dbh->do( >+ $query2, {}, >+ $samplecat2->{categorycode}, $samplecat2->{description}, >+ $samplecat2->{enrolmentperiod}, $samplecat2->{enrolmentperioddate}, >+ $samplecat2->{dateofbirthrequired}, $samplecat2->{finetype}, >+ $samplecat2->{bulk}, $samplecat2->{enrolmentfee}, >+ $samplecat2->{overduenoticerequired}, $samplecat2->{issuelimit}, >+ $samplecat2->{reservefee}, $samplecat2->{hidelostitems}, >+ $samplecat2->{category_type} >+); >+ > > > $dbh->do(q| >-- >2.43.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 18086
:
105368
|
105369
|
105380
|
105382
|
105387
|
105388
|
105424
|
105551
|
106201
|
134730
|
134731
|
168810
|
168811
|
168812
|
168813
|
168814
|
168815
|
169287
|
169288
|
169289
|
169290
|
169291
|
169292
|
169293
|
169294
|
169295
|
169296
|
169297
|
169298
|
169299
|
169300
|
169301
|
169302
|
169396
|
169397
|
169398
|
169399
|
169400
|
169401
|
169402
|
169403
|
169404
|
169455
|
169456
|
169457
|
169458
|
169459
|
169460
|
169461
|
169462
|
169463
|
169543
|
169544