title: MySQL fails to add a foreign key constraint
body: <p>I added a table 'GameRatings' in the Django model and migrated using South. The table has a one-one relationship with a table called 'Game'.</p>
  
  <p>The migration fails with the following error message:</p>
  
  <blockquote>
    <p>2014-01-07 10:51:15,026] (0.505) CREATE TABLE
    <code>app_gameratingsmodel</code> (<code>game_id</code> varchar(32) NOT NULL
    PRIMARY KEY, <code>averageRating</code> double precision NOT NULL, <code>numRatings</code>
    integer NOT NULL); args=[]</p>
    
    <p>[2014-01-07 10:51:15,650] (0.294) ALTER
    TABLE <code>app_gameratingsmodel</code> ADD CONSTRAINT
    <code>game_id_refs_gameID_fe5d3728</code> FOREIGN KEY (<code>game_id</code>) REFERENCES
    <code>app_gamemodel</code> (<code>gameID</code>);; args=[]</p>
    
    <p>FATAL ERROR - The following SQL query failed: ALTER TABLE
    <code>app_gameratingsmodel</code> ADD CONSTRAINT
    <code>game_id_refs_gameID_fe5d3728</code> 
    FOREIGN KEY (<code>game_id</code>) REFERENCES
    <code>app_gamemodel</code> (<code>gameID</code>); </p>
    
    <p>The error was: (1822, "Failed to
    add the foreign key constaint. Missing index for constraint
    'game_id_refs_gameID_fe5d3728' in the referenced table
    'app_gamemodel'")</p>
  </blockquote>
  
  <p>I don't understand what index is MySQL talking about. Can anyone help?</p>
  
  <p>Thanks.</p>