Rails migration file not adding all my defined columns to the db
I'm trying to create a rails app, but somethings going wrong, I'm getting a nasty error undefined method
title' for #`
I've used this ling:
ruby script/generate scaffold Blog title:String body:text
to generate the following migration file:
class CreateBlogs < ActiveRecord::Migration
def self.up
create_table :blogs do |t|
t.String :title
t.text :body
t.timestamps
end
end
def self.down
drop_table :blogs
end
end
Upon inspection of the database, there's no 'title' column. I've tried this with a few different names and for whatever reaso开发者_StackOverflown, even though there's two columns along with the timestamps in the migration file, after I've run rake db:migrate there's only one field in addition to the timestamps and id. Not sure why my 'title' field isn't being created :(
Shouldn't string be a lowercase 'S'?
精彩评论