ilyakatz / data-migrate

Migrate and update data alongside your database structure.
MIT License
1.4k stars 192 forks source link

`status_with_schema` doesn't work with multiple migration_paths #292

Open andrewjstrominger opened 11 months ago

andrewjstrominger commented 11 months ago

I recently found that status_with_schema doesn't work when following the Engine directions to add another migration path.

This doesn't work:

Dir.foreach(File.join(Rails.root, migrations_paths))
Errno::ENOENT: No such file or directory @ dir_initialize - HIDDEN
<internal:dir>:98:in `open'
/Users/andy.strominger/.rvm/gems/ruby-3.2.2@rotom/gems/data_migrate-9.0.0/lib/data_migrate/tasks/data_migrate_tasks.rb:70:in `foreach'

I put up a PR to fix it: https://github.com/ilyakatz/data-migrate/pull/291 The PR changes it to:

Array(migrations_paths).map do |path|
  Dir.children(path) if Dir.exist?(path)
end.flatten.compact.each do |file|

(Copy/paste from right below it).