ilyakatz / data-migrate

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

Error running db:migrate:with_data after upgrading to Rails 7.2.0.rc1 #318

Closed bruno-costanzo closed 2 months ago

bruno-costanzo commented 2 months ago

After upgrading to Rails 7.2.0rc1 with PostgreSQL DB, the command db:migrate:with_data fails with the following backtrace.

rails db:migrate:with_data --trace
Running via Spring preloader in process 29250
** Invoke db:migrate:with_data (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate:with_data
rake aborted!
NoMethodError: undefined method `with_connection' for an instance of ActiveRecord::ConnectionAdapters::PostgreSQLAdapter (NoMethodError)

      @pool.with_connection do |connection|
           ^^^^^^^^^^^^^^^^
Did you mean?  raw_connection
/home/bc/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/activerecord-7.2.0.rc1/lib/active_record/schema_migration.rb:53:in `create_table'
/home/bc/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/data_migrate-9.4.0/lib/data_migrate/data_migrator.rb:19:in `create_data_schema_table'
Morozzzko commented 2 months ago

For the reference: it should be fixed in #312

elik-ru commented 2 months ago

PR was merged, could you please release new gem version?

bruno-costanzo commented 2 months ago

This is fixed after release 9.4.4

padde commented 1 month ago

Has the version 9.4.4 been yanked on purpose from Rubygems? This is currently blocking us from upgrading Rails to 7.2. I see that subsequent 10.x release versions have also been yanked, but some release candidates exist which we'd rather not experiment with until they are deemed stable ๐Ÿ™‚ Thanks

bruno-costanzo commented 1 month ago

Yes, use the 11.0.3rc. It's going to be promoted soon.

Morozzzko commented 1 month ago

We've been running 11.0.0.rc3 for a few weeks now against 7.2 and it works well for us. So if there's a rush โ€“ย the last RC is stable enough and will just be promoted with no extra commits.

Morozzzko commented 1 month ago

@padde 11.0.0 has been released, so feel free to upgrade! https://rubygems.org/gems/data_migrate/versions/11.0.0

padde commented 1 month ago

@Morozzzko thanks for the update! Actually, we decided to get rid of data-migrate altogether instead ๐Ÿ™ˆ It wasn't fitting well with our use case anyway.