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

9.3.0 incompatible with Rails < 7 #302

Open
toby-brilliant opened this issue Mar 5, 2024 · 11 comments
Open

9.3.0 incompatible with Rails < 7 #302

toby-brilliant opened this issue Mar 5, 2024 · 11 comments
Assignees

Comments

@toby-brilliant
Copy link

toby-brilliant commented Mar 5, 2024

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)
@ngan
Copy link
Collaborator

ngan commented Mar 5, 2024

Thanks for reporting! We'll take a look

@ngan
Copy link
Collaborator

ngan commented Mar 6, 2024

@toby-brilliant can you give #303 a try?

@toby-brilliant
Copy link
Author

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")

@ngan
Copy link
Collaborator

ngan commented Mar 6, 2024

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

@toby-brilliant
Copy link
Author

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'

@jeffbax
Copy link

jeffbax commented Mar 6, 2024

Also ran into this :) ty for catching

@bruno-costanzo
Copy link
Collaborator

Is this already fixed?

@bruno-costanzo
Copy link
Collaborator

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

@Morozzzko
Copy link
Collaborator

Morozzzko commented Sep 4, 2024

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

@toby-brilliant
Copy link
Author

It does not appear to be fixed with 11. See #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)
...

@Morozzzko
Copy link
Collaborator

Reopened it is! Thank you!

@Morozzzko Morozzzko reopened this Sep 10, 2024
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

No branches or pull requests

6 participants