tesserakt
tesserakt

Reputation: 3331

Running migrations over multiple databases/Schema dump error

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.

Upvotes: 0

Views: 710

Answers (1)

tesserakt
tesserakt

Reputation: 3331

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.

Upvotes: 1

Related Questions