[Bug 5334] New: add explicit foreign key constraints
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Summary: add explicit foreign key constraints Change sponsored?: --- Product: Koha Version: HEAD Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P5 Component: Database AssignedTo: gmcharlt@gmail.com ReportedBy: gmcharlt@gmail.com QAContact: koha-bugs@lists.koha-community.org Estimated Hours: 0.0 There are many tables that lack explicit foreign key relationships to parent tables. For example: * serial (biblionumber, subscriptionid) * subscription (biblionumber) * subscriptionhistory (biblionumber, subscriptionid) * suggestions (suggestedby, managedby, rejectedby) * branch_transfer_limits (toBranch, fromBranch) and many, many others. Explicit foreign keys should be added for several reasons: * to promote better data integrity and to expose cases where the application code makes unwarranted assumptions about the database structure * to allow cascading updates and deletes in some cases * to make it easier for external reporting tools to correctly identify relationships between tables * to make use of an ORM more effective There are some arguments against this: * a complete set of FKs may decrease database speed (on the other hand, the Koha schema already uses a bunch of FKs) There are some implementation details to consider: * the database creation scripts may need some reordering * in some cases, a database update to add an FK may require dealing with rows that do not meet the new constraint. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m Depends on| |12601 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- And aqorders.budget_id, see bug 12601. -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |12555 --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- Bug 12555 is going to add a FK on aqorders_items.itemnumber. -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |13007 -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |14849 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14849 [Bug 14849] Owner should be FK in uploaded_files -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |13668 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13668 [Bug 13668] Creator of an SQL report shoudl be NULL when the staff patron is deleted -- You are receiving this mail because: You are watching all bug changes. You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |13534 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13534 [Bug 13534] Deleting staff patron will delete tags approved by this patron -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |13535 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13535 [Bug 13535] Table alert is missing FK and not deleted with the patron -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |13533 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13533 [Bug 13533] Table suggestions is missing FK constraints / borrowernumbers are kept on deletion of patron -- You are receiving this mail because: You are watching all bug changes. You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |13515 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13515 [Bug 13515] Table messages is missing FK constraints and is never cleaned up -- You are receiving this mail because: You are watching all bug changes. You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |13667 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13667 [Bug 13667] Provide script to regularly clean deletedpatrons table -- You are receiving this mail because: You are watching all bug changes. You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|13667 | Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13667 [Bug 13667] Provide script to regularly clean deletedpatrons table -- You are receiving this mail because: You are watching all bug changes. You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |13518 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13518 [Bug 13518] Table borrower_modifications is missing FK and not deleted with the patron -- You are receiving this mail because: You are watching all bug changes. You are the QA Contact for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org