data-migrate icon indicating copy to clipboard operation
data-migrate copied to clipboard

9.3.0 incompatible with Rails < 7

Open toby-brilliant opened this issue 11 months ago • 11 comments

It looks like db_configs_with_versions was only introduced in Rails 7 here but is in use by the recently released 9.3.0

Seeing:

NoMethodError undefined method `db_configs_with_versions' for module primary
at block (3 levels) in <top (required)>(/home/ruby/bundle/ruby/3.3.0/gems/data_migrate-9.3.0/tasks/databases.rake:14)

toby-brilliant avatar Mar 05 '24 15:03 toby-brilliant

Thanks for reporting! We'll take a look

ngan avatar Mar 05 '24 18:03 ngan

@toby-brilliant can you give https://github.com/ilyakatz/data-migrate/pull/303 a try?

ngan avatar Mar 06 '24 02:03 ngan

I get:

NameError: uninitialized constant DataMigrate::ActiveRecordDatabaseTasks (NameError)

      schema_mapped_versions = DataMigrate::ActiveRecordDatabaseTasks.db_configs_with_versions

with

GIT
  remote: https://github.com/ilyakatz/data-migrate.git
  revision: 688316801f2f04eb53ed5165c9014f6370653a8c
  branch: fix-rails-6
  specs:
    data_migrate (9.3.0)
      activerecord (>= 6.1)
      railties (>= 6.1)

Maybe missing a

require File.join(File.dirname(__FILE__), "data_migrate", "active_record_database_tasks")

toby-brilliant avatar Mar 06 '24 03:03 toby-brilliant

Yup. I’ll have more time to work on this tomorrow.

ngan avatar Mar 06 '24 03:03 ngan

With the require added and the "repond" typo fixed I get:

NoMethodError: undefined method `with_temporary_pool_for_each' for module primary (NoMethodError)

        with_temporary_pool_for_each do |pool|
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Did you mean?  with_temporary_connection_for_each
<internal:kernel>:187:in `loop'

toby-brilliant avatar Mar 06 '24 04:03 toby-brilliant

Also ran into this :) ty for catching

jeffbax avatar Mar 06 '24 17:03 jeffbax

Is this already fixed?

bruno-costanzo avatar Aug 19 '24 11:08 bruno-costanzo

I think this is fixed after 11.0.0rc3. I will close this issue in a few days.

bruno-costanzo avatar Aug 21 '24 18:08 bruno-costanzo

Fixed with 11.0.0 (I think). Let me know if not and we'll reopen

Morozzzko avatar Sep 04 '24 11:09 Morozzzko

It does not appear to be fixed with 11. See https://github.com/ilyakatz/data-migrate/issues/295 and my own experience:

NoMethodError: undefined method `db_configs_with_versions' for module primary
migrate_with_data(/home/ruby/bundle/ruby/3.3.0/gems/data_migrate-11.0.0/lib/data_migrate/database_tasks.rb:187)
block (3 levels) in <top (required)>(/home/ruby/bundle/ruby/3.3.0/gems/data_migrate-11.0.0/tasks/databases.rake:9)
block in execute(/home/ruby/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281)
each(/home/ruby/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281)
...

toby-brilliant avatar Sep 10 '24 14:09 toby-brilliant

Reopened it is! Thank you!

Morozzzko avatar Sep 10 '24 23:09 Morozzzko