I think loading the environment with db:create and db:drop is unnecessary. I've run into scenarios where a plugin does some initialization based on the database and raises exceptions if there is no database (ultrasphinx and acts_as_ferret are two that come to mind).
Whenever I set up an app on a new machine, and I have a plugin that expects a database installed, I have to script/dbconsole to create the database. It's not world-ending, but it is annoying. On Jul 4, 2:51 pm, Ben Munat <[EMAIL PROTECTED]> wrote: > Well, I agree that that's kind of silly. When you have a very large app, > it can take quite a bit of time to load the environment... And, when > we're talking about just creating a db, I don't see why we need the > environment. Then again, I never use db:create... I just use mysqladmin. > > b > > Andrew Bloom wrote: > > I'm just curious why you find it to be a problem that it loads the > > environment? > > > On Jul 2, 8:18 pm, Dave Rothlisberger <[EMAIL PROTECTED]> wrote: > >> If my code tries to access the database at "compile time", e.g. > >> defining methods based on values in a table, the rake db:create task > >> fails: > > >> rake aborted! > >> #42000Unknown database 'xxx_development' > > >> Why does the db:create task need to load the entire application in > >> order to create the database, instead of just reading database.yml? > > >> I'm not the first to see this, > >> e.g.http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/... > > >> andhttp://www.ruby-forum.com/topic/154561 > > >> Cheers > >> Dave > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
