How do i find out if the database exists from within a rake task?
that is, i'd like to do something like:
task :drop_and_create => :environment do
Rails.env = "development"
if (db_exists?)
Rake::Task["db:drop"].invoke
end
Rake::Task["db:create"].invoke
#more stuff...
end
how do i write the db_exists? condition?