Bug 25731

Summary: The table authorised_values_branches should have foreign key constraints
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart
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 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;