https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18086

Victor Grousset/tuxayo <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |Failed QA

--- Comment #80 from Victor Grousset/tuxayo <[email protected]> ---
updatedatabase fails to cleanup a case.

- DB prior to update
MariaDB [koha_kohadev]> select * from overduerules\G
*************************** 1. row ***************************
overduerules_id: 1
     branchcode: tmplib
   categorycode: B
         delay1: 1
        letter1: ACCOUNT_DEBIT
      debarred1: 1
         delay2: 2
      debarred2: 1
        letter2: AR_SLIP
         delay3: 3
        letter3: AR_PENDING
      debarred3: 1
*************************** 2. row ***************************
overduerules_id: 2
     branchcode: 
   categorycode: TMPCAT
         delay1: 1
        letter1: ISSUEQSLIP
      debarred1: 1
         delay2: 2
      debarred2: 1
        letter2: ISSUESLIP
         delay3: 3
        letter3: ISSUESLIP
      debarred3: 1
2 rows in set (0.000 sec)

- applied patches
- updatedatabase:
DEV atomic update
/kohadevbox/koha/installer/data/mysql/atomicupdate/bug_18086.pl  [21:38:51]:
Bug 18086 - Add foreign key constraints to table overduerule
        Added constraint to column of table 'overduerules.branchcode'
ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Cannot add or
update a child row: a foreign key constraint fails
(`koha_kohadev`.`#sql-alter-1-35`, CONSTRAINT `categorycode_ibfk` FOREIGN KEY
(`categorycode`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON
UPDATE CASCADE) at /kohadevbox/koha/C4/Installer.pm line 741

- DB after update
MariaDB [koha_kohadev]> select * from overduerules\G
*************************** 1. row ***************************
overduerules_id: 2
     branchcode: NULL
   categorycode: TMPCAT
         delay1: 1
        letter1: ISSUEQSLIP
      debarred1: 1
         delay2: 2
      debarred2: 1
        letter2: ISSUESLIP
         delay3: 3
        letter3: ISSUESLIP
      debarred3: 1
1 row in set (0.000 sec)


I had two cases of corrupt data:
- deleted library and valid patron category: worked
- default (empty string before the update) library and deleted patron category:
failed

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to