Rails 2.0 DB create/drop tasks
- February 14th, 2008
- Posted in Development . Ruby on Rails
- Write comment
It’s impossible to get a database model right the first time. Often, you end up with a db with a half-finished, garbage schema. Hibernate makes this more tolerable, if you set the hibernate.hbm2ddl.auto flag to create it will just wipe the DB when your container restarts.
Until 2.0, Rails didn’t have something similar and I either had to manually drop/create the DB, or hope that rake db:migrate VERSION=0 did what I needed. Thankfully, Rails 2.0 offers the perfect set of rake tasks:
rake db:create and rake db:drop. Just another way the Rails team alleviates some of the pain of web development.
This is my blog about programming. For random stuff, checkout my
Very useful feature indeed… I use it very often… It allows me to do the necessary modifications with ease…