datamapper/dm-migrations — pull request #52 by mltsy (2013-07-03 19:53:02+00:00)
Title: An exception is raised when trying to migrate with MasterSlaveAdapter

I can't figure out what the most sensible solution is to this issue, but this is one possible solution.

Since dm-migrations only supports adapters with class names matching the specified expressions (`/Sqlite/' '/Mysql/' and '/Postgres/`), any other adapter is excluded, which perhaps makes sense if the underlying libraries only support those databases. However, this particular adapter just aggregates child adapters that can be setup to use any of those databases and yet, it is rejected here - so I think this master-slave setup is a unique use-case that should be dealt with independently, like this, by selecting the master adapter explicitly and using that for all migration-related tasks.

That's my theory... (and it seems to work at least). It does create a loose coupling between these two gems, since the master-slave adapter has to have a "master" method that returns a recognized adapter, and that's not already part of the DataMapper adapter spec/interface, but... I can't think of a better solution.