Summary: | Foreign key constraint for message_transports is too loose | ||
---|---|---|---|
Product: | Koha | Reporter: | Barton Chittenden <barton> |
Component: | Notices | Assignee: | Bugs List <koha-bugs> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | jonathan.druart, kyle |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 5334 |
Description
Barton Chittenden
2016-08-22 14:23:03 UTC
Barton, I understand the problem but it does not look so easy to fix it. In the message_transports we have MariaDB [koha]> select message_transport_type, letter_module, letter_code from message_transports; +------------------------+---------------+-------------+ | message_transport_type | letter_module | letter_code | +------------------------+---------------+-------------+ | email | circulation | CHECKIN | | sms | circulation | CHECKIN | | email | circulation | CHECKOUT | | sms | circulation | CHECKOUT | | email | circulation | DUE | | sms | circulation | DUE | | email | circulation | DUEDGST | | sms | circulation | DUEDGST | | email | circulation | PREDUE | | sms | circulation | PREDUE | | email | circulation | PREDUEDGST | | sms | circulation | PREDUEDGST | | email | reserves | HOLD | | sms | reserves | HOLD | +------------------------+---------------+-------------+ 14 rows in set (0.10 sec) But the letter table does necessarily contain a sms template for CHECKIN or CHECKOUT (or whatever). If it does not exist, we won't be able to create the FK correctly. (In reply to Jonathan Druart from comment #1) > Barton, I understand the problem but it does not look so easy to fix it. <snip> > But the letter table does necessarily contain a sms template for CHECKIN or > CHECKOUT (or whatever). > If it does not exist, we won't be able to create the FK correctly. I see your point... can we remove ON DELETE CASCADE ON UPDATE CASCADE from CONSTRAINT `message_transports_ibfk_3` FOREIGN KEY (`letter_module`, `letter_code`, `branchcode`) REFERENCES `letter` (`module`, `code`, `branchcode`) ON DELETE CASCADE ON UPDATE CASCADE So that at least we're not losing lines in 'message_transports' if we happen to delete a row from the letter table? Wondering - how would you delete a single message transport line without SQL? In the GUI the letter with all its message types appears as one thing that can only be deleted completely. (In reply to Katrin Fischer from comment #3) > Wondering - how would you delete a single message transport line without > SQL? In the GUI the letter with all its message types appears as one thing > that can only be deleted completely. Cait, I'm pretty sure that updatedatabase did it on Bug 13171. |