Nic Lin's Blog

喜歡在地上打滾的 Rails Developer

在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
Share Comments
comments powered by Disqus