Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top