 <p>I have been able to solve the problem.</p> <p>Seemingly, the index for the foreign key must have the same column order that the constraint, which is something that I didn't find specified. </p> <p>Changing the constraint to <code>`fk_id_checklist` , `fk_id_user` , `fk_id_user_company` , `fk_sent_date`</code> solves this error.</p>