module EngineName
class Engine < ::Rails::Engine
initializer :engine_name do |app|
::DataMigrate.configure do |data_migrate|
default_path = ::DataMigrate::Config.new.data_migrations_path
data_migrate.data_migrations_path = [default_path, root.join('db', 'data')]
end
end
end
end
The resulting migration file path is made up of all of the paths names so in our case it was ./db/data/engines/db/data/engines/something/db/data. This fix just picks the first path ie. the application's db/data path.
The proposed solution for Rails engines with multiple data migration paths causes a side-effect.
https://github.com/ilyakatz/data-migrate/issues/314
The resulting migration file path is made up of all of the paths names so in our case it was
./db/data/engines/db/data/engines/something/db/data
. This fix just picks the first path ie. the application's db/data path.Hope this is helpful.