That’s kind of cool, I was reading a post about DHH Keynote at RailsConf Europe when I realized that DHH mentioned one of my contribution to Rails Edge.

“small, but to me significant improvement has also found its way to Rails 2.0: You can now create the needed databases with a rake command. By running this command, all referenced databases in your database.yml will be created”


rake db:create:all

I’m glad to see that my contribution is appreciated, as a reminder you also have the following options:

Only create your current environment database (can be useful to bootstrap your application):


rake db:create

Another command I use often in development is:


rake db:reset

It simply drops your current environment database, re create it and migrate it :)
(btw, your new database will be utf-8 by default)

Here is a list of the new rake tasks:

1
2
3
4
rake db:create                       # Create the local database defined in config/database.yml for the current RAILS_ENV
rake db:create:all                   # Create all the local databases defined in config/database.yml
rake db:drop                         # Drops the database for the current environment
rake db:reset                         # Drops, creates and then migrates the database for the current environment. Target specific version with VERSION=x

Read DHH Keynote summary there