I’m failing at finding out how to create a database from ActiveRecord if one doesn’t already exist. I’ve looked at this: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html#method-i-create_database, but it doesn’t want to play nice, as far as I can tell… I’m not sure what I’m missing here. Is this even possible?
Thanks!
I managed to cobble together this thing that works with both heroku and on my local machine, and will create a database if one doesn’t exist.
And here’s a Rakefile that uses it.
Problem solved.