title: Cannot add foreign key to table
body: <p>I have a problem to add foreign key to existing table, I always get error </p>
  
  <pre><code>ERROR 1005(HY000): Can't create table '#sql-a1f-b84' (errno: 150)
  </code></pre>
  
  <p>I tried like </p>
  
  <pre><code>ALTER TABLE alliances ADD CONSTRAINT fk_alliance_id FOREIGN KEY (alliance_id) references alliances(id);
  </code></pre>
  
  <p>When I do <code>DESCRIBE alliances;</code></p>
  
  <pre><code>Field  Type    Null   Key  Default  Extra
  id     int(11) NO     PRI  NULL     auto_increment
  name   bigint(2) YES       NULL      
  </code></pre>
  
  <p>When I do <code>DESCRIBE alliance_invitation;</code></p>
  
  <pre><code>Field        Type    Null   Key  Default  Extra
  id           int(11) NO     PRI  NULL     auto_increment
  alliance_id  int(11) NO             
  </code></pre>
  
  <p>Can anyone tell me what is a problem ?</p>