Skip to content

Conversation

@braindeaf
Copy link

The proposed solution for Rails engines with multiple data migration paths causes a side-effect.

#314

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.

Hope this is helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant