I have been have ripping my hair out for the past week trying to get back my Foreign Key constraints on my contact table in Elastix.
The constraints I am trying to replicate are the following: Replicate these foreign keys
I have tried:
ALTER TABLE contact ADD CONSTRAINT (
id_agent) REFERENCES agent(id);
but to no avail. I get the response:
SQL query: ALTER TABLE call_entry ADD CONSTRAINT call_entry_ibfk_3 FOREIGN KEY(id_contact) REFERENCES contact.id MySQL said: #1005 - Can't create table 'call_center.#sql-888_37e3e' (errno: 150)
All the databases agent,queue_call_entry,campaign_entry exist and have data. The structure of the contact table is here: contact table structure
Any help will be highly appreciated, thank you for your time.