rails / solid_queue

Database-backed Active Job backend
MIT License
1.84k stars 110 forks source link

New queue_schema.rb file hardcodes Rails version #323

Closed fractaledmind closed 1 month ago

fractaledmind commented 1 month ago

After #321, Solid Queue can't be added to any new Rails 7.2 applications. I just reported this problem with Solid Cache in https://github.com/rails/solid_cache/issues/211, and this will have the exact same problem:

bin/rails aborted!
ArgumentError: Unknown migration version "8.0"; expected one of "4.2", "5.0", "5.1", "5.2", "6.0", "6.1", "7.0", "7.1", "7.2" (ArgumentError)

          raise ArgumentError, "Unknown migration version #{version.inspect}; expected one of #{versions.sort.join(', ')}"
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/fractaled/Code/Playgrounds/euruko-2024/db/cache_schema.rb:3:in `<main>'

I stumbled into this preparing my workshop for EuRuKo next week, where we are spinning up new Rails 7.2.1 apps and installing the Solid gems.

rosa commented 1 month ago

Oops, so sorry! We're running it with Rails 8, and I didn't think of that 🤦‍♀️ .

rosa commented 1 month ago

The new schema is completely compatible with Rails 7.1, which is the minimum version required to use Solid Queue, so I'll just revert to that.

fractaledmind commented 1 month ago

Perfect. Thanks. And no worries, this is exactly the kind of tiny little bug that inevitably sneaks thru. One of the wonderful things about open source is that the collective community will do a much better job of finding all of these cases than any one individual. Excited to see things coming together for Rails 8 tho!

rosa commented 1 month ago

@fractaledmind would you mind double-checking that the last main works fine for you? 😅 I'll ship v.0.8.1 with if so.

fractaledmind commented 1 month ago

Yes. bin/rails solid_queue:install followed by bin/rails db:prepare DATABASE=queue worked

rosa commented 1 month ago

Awesome! Thank you so much 🙏