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

data-migrate breaks after upgrade to rails 7 #191

Closed
aka47 opened this issue Jun 2, 2021 · 4 comments
Closed

data-migrate breaks after upgrade to rails 7 #191

aka47 opened this issue Jun 2, 2021 · 4 comments

Comments

@aka47
Copy link

aka47 commented Jun 2, 2021

Rails 7 is the next release coming up.

in our Gemfile we have
gem "rails", "7.0.0.alpha", git: 'https://github.com/rails/rails.git', branch: 'main'

An upgrade is not possible with data-migrate because of the following exception:

NameError: undefined method `migrations_status' for class `#<Class:DataMigrate::DataMigrator>'
/Users/tim/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/data_migrate-7.0.1/lib/data_migrate/data_migrator.rb:23:in `alias_method'
/Users/tim/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/data_migrate-7.0.1/lib/data_migrate/data_migrator.rb:23:in `singleton class'
/Users/tim/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/data_migrate-7.0.1/lib/data_migrate/data_migrator.rb:22:in `<class:DataMigrator>'
/Users/tim/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/data_migrate-7.0.1/lib/data_migrate/data_migrator.rb:6:in `<module:DataMigrate>'
/Users/tim/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/data_migrate-7.0.1/lib/data_migrate/data_migrator.rb:5:in `<main>'

this PR might be a helpful start .. rails/rails#40806

@afomera
Copy link

afomera commented Jun 17, 2021

I also ran into this tonight.

Looks like it's related to the Major version bump from 6 to 7 and some various places checking for it to be 6 to set the migration context and whatnot.

I started a branch here on a fork: https://github.com/podia/data-migrate/tree/rails-7, but ran into trouble trying to setup/run tests in the project here.

If you're curious, I created a sample app to reproduce the issues here: https://github.com/afomera/data-migrate-rails-7 (use rails-6 branch after cloning it locally to bundle / create the Postgres db successfully).

After running bundle, trying to run bin/rails server on a basic Rails 7 install fails, unless you use the fork version with the changes to lib/data_migrate.rb to extend the check for the major Rails 7 version.

I ran out of time tonight to continue trying to get specs to run, but maybe this gets things going a little further.

@aka47
Copy link
Author

aka47 commented Dec 14, 2021

started a PR #198

@bmulholland
Copy link

bmulholland commented Aug 2, 2022

Shouldn't #204 have closed this?

@Morozzzko
Copy link
Collaborator

Morozzzko commented Sep 4, 2024

Think it's safe to say this one is fixed* now

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

4 participants