2013-02-12 44 views
0

我是RoR的初學者,只需在Lynda上按照「Ruby on Rails 3基本培訓與凱文Skoglund」。rake db:migrate在我的桌面上顯示沒有變化

由於一些錯字,所以我被困住了,我把桌子放到原來的狀態。 但是我做完了之後,我無法再改變我的桌子了。無論嘗試使用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 

回答

0

你可以只刪除並重新創建數據庫,使用:

rake db:reset 
rake db:migrate 

rake db:drop 
rake db:create 
rake db:migrate 
+0

謝謝,它確實有效! – Iseng 2013-02-13 21:54:16

相關問題