Bug 25731 - The table authorised_values_branches should have foreign key constraints
Summary: The table authorised_values_branches should have foreign key constraints
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 5334
  Show dependency treegraph
 
Reported: 2020-06-12 16:58 UTC by Kyle M Hall (khall)
Modified: 2023-06-08 22:26 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2020-06-12 16:58:17 UTC
Simply put, authorised_values_branches has two columns both of which should have FK constraints, but neither do!
Comment 1 Jonathan Druart 2020-06-16 13:59:54 UTC
Kyle, they both have the correct foreign key:

CREATE TABLE authorised_values_branches( -- association table between authorised_values and branches
    av_id INT(11) NOT NULL,
    branchcode VARCHAR(10) NOT NULL,
    FOREIGN KEY (av_id) REFERENCES authorised_values(id) ON DELETE CASCADE,
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;