title: Cannot add or update a child row: a foreign key constraint fails
body: <p>These are the create statement for the two tables that i am facing the issue with:
  First Table:</p>
  <pre class="lang-sql prettyprint-override"><code> CREATE TABLE `hrm__companyteam` (
   `id_team` int(11) NOT NULL AUTO_INCREMENT,
   `id_department` int(11) NOT NULL,
   `team_name` varchar(255) NOT NULL DEFAULT '',
   `notes` mediumtext NOT NULL,
   PRIMARY KEY (`id_team`),
   KEY `id_company` (`id_department`),
   CONSTRAINT `hrm__companyTeam_ibfk_1` FOREIGN KEY (`id_department`) REFERENCES `hrm__companydepartment` (`id_department`) ON DELETE CASCADE,
   CONSTRAINT `hrm__companyteam_ibfk_1` FOREIGN KEY (`id_department`) REFERENCES `hrm__companydepartment` (`id_department`) ON DELETE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8
  </code></pre>
  <p>Second Table</p>
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE `hrm__companyjobtitle` (
   `id_job_title` int(11) NOT NULL AUTO_INCREMENT,
   `id_team` int(11) NOT NULL DEFAULT '0',
   `job_title_name` varchar(255) NOT NULL DEFAULT '',
   `notes` mediumtext NOT NULL,
   PRIMARY KEY (`id_job_title`),
   KEY `id_division` (`id_team`),
   CONSTRAINT `hrm__companyJobTitle_ibfk_1` FOREIGN KEY (`id_team`) REFERENCES `hrm__companyteam` (`id_team`) ON DELETE CASCADE,
   CONSTRAINT `hrm__companyjobtitle_ibfk_1` FOREIGN KEY (`id_team`) REFERENCES `hrm__companyteam` (`id_team`) ON DELETE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8
  </code></pre>
  <p>When i try to execute the following query:</p>
  <pre class="lang-sql prettyprint-override"><code>INSERT INTO `hr_db`.`hrm__companyjobtitle` (
  
  `id_job_title` ,
  `id_team` ,
  `job_title_name` ,
  `notes`
  )
  VALUES (
  '1',  '1',  'IT',  ''
  )
  </code></pre>
  <p>I get this error:</p>
  <h1>1452 - Cannot add or update a child row: a foreign key constraint fails (<code>hr_db</code>.<code>hrm__companyjobtitle</code>, CONSTRAINT <code>hrm__companyJobTitle_ibfk_1</code> FOREIGN KEY (<code>id_team</code>) REFERENCES <code>hrm__companyteam</code> (<code>id_team</code>) ON DELETE CASCADE)</h1>
  <p>Please help... What am i doing wrong. Also please let me know if you need any further details.</p>