我是 RoR 的初学者,只关注 Lynda 上的“Ruby on Rails 3 Essential Training with Kevin Skoglund”。
由于一些错字,所以我被卡住了,我把桌子放到了原来的状态。但是在我这样做之后,我不能再改变我的桌子了。无论尝试 rake db:migrate version=0 还是 rake db:migrate ,终端都不会显示任何错误信号。
以下是我的迁移代码
class CreateSections < ActiveRecord::Migration
def self.up
create_table :sections do |t|
t.integer "pages_id"
t.string "name"
t.integer "position"
t.boolean "visible" , :default => false
t.string "content_type"
t.string "content"
t.timestamps
end
add_index("sections", "pages_id")
end
def self.down
drop_table :sections
end
end