0

Anyone have a workaround (without monkey patching rails) for the failure of the db:schema:dump part of a simple migration accessing the wrong database for a table? I get the error

*Mysql::Error: View 'database1.boxscores' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them: SHOW FIELDS FROM boxscores *

When boxscores is on database2. The ActiveRecord model is set to make the connection and the app works fine, it isjust the migration that fails, and that only b/c of the schema dump.

1
  • By adding an Active Record connect I was able to solve this issue. It also turns out that the models for those tables were not overriding the default DB connection like they should have been. Commented Feb 1, 2011 at 22:10

1 Answer 1

1

I am going to answer this since I found the answer and it might help someone. No one else answered, so here we go:

By adding an Active Record connect I was able to solve this issue. It also turns out that the models for those tables were not overriding the default DB connection like they should have been.

Sign up to request clarification or add additional context in comments.

1 Comment

What do you mean by Active Record connect? Do you mean create a model for the view? I'm having the same issue and it's very difficult to find any answers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.