Posting the results of running the rake command with --trace always
helps, but I'd say the likely culprit here is something in your
environment / initializers. Does that function get called from
environment.rb or an initializer?

--Matt Jones

On Aug 11, 12:31 am, Polydectes <[email protected]> wrote:
> Rails 2.3.2.  Ruby 1.8.7.  MySQL 5.x
>
> I have used "rake db:schema:dump" to generate a migration structure to
> go from development to production.  I want to use "rake
> db:schema:load" to load it into my new database.  Sounds like a plan.
>
> When I run "rake db:schema:load" on the new database (development or
> production), I get the following error:
>
> <from development test>
> rake aborted!
> Mysql::Error: Table 'mojo_development.statuses' doesn't exist: SELECT
> * FROM `statuses` WHERE (`statuses`.`name` = 'New')  LIMIT 1
>
> (production gives the same, but database name is mojo_production).
>
> The Select is not in the schema.  If I trace it back, I find the
> Select is generated from the following method in my Mojo model:
>
>   def self.new_state
>     for_name('New').first
>   end
>
> where for_name is a :named_scope generating the select statement
> above.
>
> So my questions are:
>
> 1) WHY does db:schema:load run queries against my database when the
> data (and tables) aren't there?
>
> and
>
> 2) HOW do I fix this so it won't happen again?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to