ankane/multiverse

Fixtures do not work when using two different DB adapter types

timkrins opened this issue · 2 comments

Noticed an issue with fixtures when using both a MySQL and a Postgres database with multiverse.

The issue seems to be due to the Arel query builder - it is building the fixture insert SQL for the MySQL database, and then running the insert command into the Postgres DB (which fails at a minimum because of the inclusion of backticks)

The conn.insert_fixtures_set in ActiveRecord fixtures calls the abstract connection adaptor build_fixture_sql, with the underlying Arel::Table.engine.connection defaulting to ActiveRecord::Base (MySQL), which produces the wrong query.

I have not yet explored more in depth to figure out a logical place to hook in to fix this.

Hey @timkrins, thanks for reporting 👍 Since Multiverse becomes obsolete with Rails 6, I don't plan to spend too much time on it, but happy to review a PR if you figure out a clean-ish way to make it work.

Cleaning up issues, but added a note to the readme. Thanks for pointing this out.