title: Creating tables and problems with primary key in Rails
body: <p>When I try to run the following code in Rails using Mysql2 as database manager:</p>
  
  <pre><code>rake db:migrate
  </code></pre>
  
  <p>I obtain the following error:</p>
  
  <pre><code> rake aborted!
   "Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL:"
  </code></pre>
  
  <p>Why do I get this error, if the primary key in a table by default is NOT "null"?</p>
  
  <p>Migration code, however :</p>
  
  <pre><code>class CreateUsers &lt; ActiveRecord::Migration
     def change
      create_table :users do |t|
       t.string "first_name"
       t.timestamps
      end
     end 
  end
  </code></pre>