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

feat: Allow multiple data_migrations_path values #331

Merged

Conversation

jordanbyron
Copy link

This PR adds the ability for multiple data_migration_paths to be set. This is useful for Rails applications leveraging
tools like Packwerk / Packs to split up their codebase into multiple packages.

Multiple paths can be specified in the data_migration_paths configuration option, however the default of one path is
still valid.

# config/initializers/data_migrate.rb

DataMigrate.configure do |config|
  config.data_migrations_path = ['db/data/'] + Dir['packs/**/db/data']
end

The first path in the array is the default path which is used when generating new data migration files.

Much of this code was borrowed from #244, but I had to make some changes to get it working with the latest version.

@vprigent
Copy link
Collaborator

Apologies for the delay and thanks for the PR @jordanbyron!

I think its a great addition and will certainly make modularized apps integration with data-migrate easier. 👍

@vprigent vprigent merged commit 2d29c02 into ilyakatz:main Sep 17, 2024
13 checks passed
@jordanbyron jordanbyron deleted the chore/support-multiple-migration-paths branch September 17, 2024 10:38
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.

2 participants