title: Foreign Key on Laravel Migration causing General Error 1215
body: <p>I'm trying to create multiple tables with foreign keys using Laravels migration. I have a problems migration table like so</p>
  
  <pre><code>Schema::create('problems', function($table)
          {
              $table-&gt;increments('id');
              $table-&gt;integer('created_by')-&gt;unsigned();
              $table-&gt;foreign('created_by')-&gt;references('id')-&gt;on('users');
              $table-&gt;integer('category')-&gt;unsigned();
              $table-&gt;foreign('category')-&gt;references('id')-&gt;on('categories');
              $table-&gt;timestamps();
          });
  </code></pre>
  
  <p>A categories migration</p>
  
  <pre><code>Schema::create('categories', function($table)
          {
              $table-&gt;increments('id');
              $table-&gt;string('category_name');
              $table-&gt;timestamps();
          });
  </code></pre>
  
  <p>My first foreign key into the users migration works fine but as soon as it hits the foreign key for the category id, it gives a </p>
  
  <blockquote>
    <p>SQLSTATE HY000 General Error 1215 Impossible d'ajouter des contraintes
    d'index externe (SQL; alter table 'problems' add constraint
    problems_category_foreign foreign key ('category') references
    'categories' ('id'))</p>
  </blockquote>
  
  <p>(I can't properly read the French and I don't know why it gives me errors in French. I have not been able to find a way to change it as I am not French, nor can I understand it)</p>
  
  <p>I don't understand why this would work for one and not the other when they are essentially the same thing.</p>