title: Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead
body: <p>I have created a demo application in <code>rails 3.2.9</code> and <code>ruby versiion 2.0.0</code> . After scaffolding Blog model I am trying to migrate it, but having following issue.</p>
  
  <blockquote>
    <p># rake db:migrate</p>
    
    <p>==  CreateBlogs: migrating ====================================================</p>
    
    <p>-- create_table(:blogs) 
    rake aborted!</p>
    
    <p>StandardError: An error has occurred, all later migrations canceled:</p>
    
    <p>Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead: CREATE TABLE <code>blogs</code> (<code>id</code> int(11) DEFAULT NULL auto_increment PRIMARY KEY, <code>title</code> varchar(255), <code>description</code> text, <code>created_at</code> datetime NOT NULL, <code>updated_at</code> datetime NOT NULL) ENGINE=InnoDB
    /usr/local/rvm/gems/ruby-2.0.0-p648@demo-app/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in <code>query'
    /usr/local/rvm/gems/ruby-2.0.0-p648@demo-app/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in</code>block in execute'
    /usr/local/rvm/gems/ruby-2.0.0-p648@demo-app/gems/activerecord-</p>
  </blockquote>
  
  <p>....</p>
  
  <p>....</p>
  
  <p>....</p>
  
  <blockquote>
    <p>-3.2.9/lib/active_record/migration.rb:551:in <code>migrate'
    /usr/local/rvm/gems/ruby-2.0.0-p648@demo-app/gems/activerecord-3.2.9/lib/active_record/railties/databases.rake:179:in</code>block (2 levels) in '
    /usr/local/rvm/gems/ruby-2.0.0-p648@demo-app/gems/rake-11.3.0/exe/rake:27:in `'
    Tasks: TOP => db:migrate
    (See full trace by running task with --trace)</p>
  </blockquote>