title: Error 1005 when adding a foreign key constraint on mysql table
body: <p>I have a problem when upgrading a django and mysql app with south. </p>
  
  <p>I've tried to make a sql-based upgrade with the code generated by the django sqlall command and I have a similar problem.</p>
  
  <p>Here is the sql code:</p>
  
  <pre><code>CREATE TABLE `programmations_basissupport` (
      `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
      `value` numeric(6, 0) NOT NULL
  )
  
  ALTER TABLE `programmations_concert` ADD `basis_support_id` integer AFTER program_status_id;
  
  ALTER TABLE `programmations_concert` ADD CONSTRAINT `basis_support_id_refs_id_1e4ed8d7` FOREIGN KEY (`basis_support_id`) REFERENCES `programmations_basissupport` (`id`);
  </code></pre>
  
  <p>An error is raised when adding the FK constraint:</p>
  
  <pre><code>ERROR 1005 (HY000): Can't create table 'apidev_mnl.#sql-106e_632b00a' (errno: 150)
  </code></pre>
  
  <p>Does anybody have an idea?</p>
  
  <p>Update: DEFAULT values where missing but even if I add the default='' in the django model, the creation of foreign keys fails.</p>
  
  <p>Thanks for your help</p>