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
Here is a list of the new tasks:
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
The cool think is that your newly created will be utf-8, if you aren't sure
what's your actual charset or collation you can also use the 2 other rake
tasks I added:
rake db:charset # Retrieves the charset for the current
environment's database
rake db:collation # Retrieves the collation for the
current environment's database
I personally use rake db:reset all the time when I'm working on a migration
that I'm tweaking before committing it.
I also always create a rake task called bootstrap that I use to setup the
production environment.
-Matt
--
m|a consulting
--------
(760) 536-4425
Skype: mattdesktop
GTalk: [EMAIL PROTECTED]
blog: http://railsontherun.com
On 9/19/07, Patrick Crowley <[EMAIL PROTECTED]> wrote:
>
> > rake db:create
>
> Nice, Matt. I was thinking earlier today how dumb it is that I have
> to create databases every time I run the "rails" command.
>
> -- Patrick
>
>
>
>
>
> _______________________________________________
> Sdruby mailing list
> [email protected]
> http://lists.sdruby.com/mailman/listinfo/sdruby
>
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby