Nic Lin's Blog

喜歡在地上滾的工程師

在Rails上回溯操作的方法

generate和destroy是相反

rails generate controller FooBars baz quux
rails destroy controller FooBars baz quux
rails generate model Foo bar:string baz:integer
rails destroy model Foo

migrate和rollback相反

rake db:migrate
rake db:rollback

回到初始狀態

rake db:migrate VERSION=0
comments powered by Disqus