Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for rails g data_migration with multiple data migration paths #315

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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