Closed cyber-sparky closed 1 year ago
I think, foreign key is added only if the referenced column in another table is a primary key or Unique. So make the name colum in the leave_types as UNIQUE and check whether that works.
Thanks @barathcharm, its works fine. Thank you for the help to resolve the problem. So far this is issue is resolved I'm closing this issue.
SQL File
I'm facing an issue while creating a table. When I try to create the employee_leave_balance table, I receive an error message: Error Code: 1822. Failed to add the foreign key constraint. Missing index for constraint 'employee_leave_balance_ibfk_2' in the referenced table 'leave_types' 0.000 sec
Could you please provide some guidance to resolve this issue?