jenseng/hair_trigger

Rails 8 support

Closed this issue · 4 comments

I'm getting an error while executing "bundle exec rails db:migrate" command.

ArgumentError: wrong number of arguments (given 2, expected 4..5) (ArgumentError)
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/migration.rb:1421:in `initialize'
/home/app/api/.bundle/gems/hairtrigger-0.2.21/lib/hair_trigger.rb:53:in `new'
/home/app/api/.bundle/gems/hairtrigger-0.2.21/lib/hair_trigger.rb:53:in `migrator'
/home/app/api/.bundle/gems/hairtrigger-0.2.21/lib/hair_trigger.rb:71:in `current_migrations'
/home/app/api/.bundle/gems/hairtrigger-0.2.21/lib/hair_trigger/schema_dumper.rb:23:in `triggers'
/home/app/api/.bundle/gems/hairtrigger-0.2.21/lib/hair_trigger/schema_dumper.rb:7:in `trailer'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/schema_dumper.rb:67:in `dump'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/schema_dumper.rb:46:in `block in dump'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:406:in `with_connection'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/schema_dumper.rb:45:in `dump'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/tasks/database_tasks.rb:442:in `block in dump_schema'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/tasks/database_tasks.rb:441:in `open'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/tasks/database_tasks.rb:441:in `dump_schema'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/railties/databases.rake:471:in `block (6 levels) in <top (required)>'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/tasks/database_tasks.rb:546:in `with_temporary_pool'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/tasks/database_tasks.rb:515:in `with_temporary_pool_for_each'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/railties/databases.rake:468:in `block (5 levels) in <top (required)>'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/railties/databases.rake:109:in `block (4 levels) in <top (required)>'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/app/api/.bundle/gems/activerecord-8.0.0/lib/active_record/railties/databases.rake:127:in `block (4 levels) in <top (required)>'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/home/app/api/.bundle/gems/railties-8.0.0/lib/rails/commands/rake/rake_command.rb:27:in `block (2 levels) in perform'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/home/app/api/.bundle/gems/railties-8.0.0/lib/rails/commands/rake/rake_command.rb:27:in `block in perform'
/home/app/api/.bundle/gems/railties-8.0.0/lib/rails/commands/rake/rake_command.rb:44:in `block in with_rake'
/home/app/api/.bundle/gems/rake-13.2.1/lib/rake/rake_module.rb:59:in `with_application'
/home/app/api/.bundle/gems/railties-8.0.0/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/home/app/api/.bundle/gems/railties-8.0.0/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/app/api/.bundle/gems/railties-8.0.0/lib/rails/command.rb:150:in `invoke_rake'
/home/app/api/.bundle/gems/railties-8.0.0/lib/rails/command.rb:67:in `block in invoke'
/home/app/api/.bundle/gems/railties-8.0.0/lib/rails/command.rb:143:in `with_argv'
/home/app/api/.bundle/gems/railties-8.0.0/lib/rails/command.rb:63:in `invoke'
/home/app/api/.bundle/gems/railties-8.0.0/lib/rails/commands.rb:18:in `<top (required)>'

@viktor-shmigol You are using an old version on HairTrigger, 0.2.21. If you upgrade to Rails 8 it will downgrade hair trigger to an older version which does not have the restriction of activerecord < 8 like the latest version have:
https://github.com/jenseng/hair_trigger/blob/master/hairtrigger.gemspec#L23

There is a PR to fix this #133

@Linuus I'm getting an error while upgrading it to gem 'hairtrigger', '~> 1.2'

Could not find compatible versions

Because rails >= 8.0.0 depends on activerecord = 8.0.0
  and hairtrigger >= 1.0.0 depends on activerecord >= 6.0, < 8,
  rails >= 8.0.0 is incompatible with hairtrigger >= 1.0.0.
So, because Gemfile depends on hairtrigger ~> 1.2
  and Gemfile depends on rails ~> 8.0.0,
  version solving has failed.

@Linuus I'm getting an error while upgrading it to gem 'hairtrigger', '~> 1.2'

Could not find compatible versions

Because rails >= 8.0.0 depends on activerecord = 8.0.0
  and hairtrigger >= 1.0.0 depends on activerecord >= 6.0, < 8,
  rails >= 8.0.0 is incompatible with hairtrigger >= 1.0.0.
So, because Gemfile depends on hairtrigger ~> 1.2
  and Gemfile depends on rails ~> 8.0.0,
  version solving has failed.

Yes, as I mentioned above we need to merge #133 first since HairTrigger depends on activerecord < 8.

v1.3.0 has been released with rails 8 support