I created a demo application in rails 3.2.9and ruby versiion 2.0.0. After creating a forest blog model, I try to migrate it, but I have the following problem.
# rake db: migrate
== CreateBlogs: migration ============================================= ================================================
- create_table (: blogs) rake interrupted!
StandardError: an error occurred, all subsequent migrations are canceled:
Mysql2 :: Error: all parts of the PRIMARY KEY must be NOT NULL; if you need NULL in the key, use UNIQUE instead: CREATE TABLE blogs( idint (11) DEFAULT NULL auto_increment PRIMARY KEY, titlevarchar (255), descriptiontext, created_atdatetime NOT NULL, updated_atdatetime 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 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:inblock in execute '/ usr / local / rvm / gems / ruby - 2.0.0-p648@demo-app / gems / activerecord -
....
....
....
-3.2.9/lib/active_record/migration.rb: 551: 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 (2 ) ' /usr/local/rvm/gems/ruby -2.0.0-p648@demo-app/gems/rake-11.3.0/exe/rake:27:in `' : TOP = > db: migrate (. , --trace)