开发者

Want to re-create table when running rake db:seed

开发者 https://www.devze.com 2023-02-15 04:12 出处:网络
I want to remove all tables and re-created the db when I run rake db:create The 开发者_如何学JAVAreason is the id\'s on the tables are not set to 1, so I figured i can just re-create the db if its

I want to remove all tables and re-created the db when I run

rake db:create

The 开发者_如何学JAVAreason is the id's on the tables are not set to 1, so I figured i can just re-create the db if its possible, or call truncate.


 rake db:reset

may be what you are looking for. or...

 rake db:drop
 rake db:create


Try rake db:reset (in Rails 3)

In Rails 2, maybe this will help: http://pivotallabs.com/users/alex/blog/articles/305-collapsing-migrations

0

精彩评论

暂无评论...
验证码 换一张
取 消