solid_queue icon indicating copy to clipboard operation
solid_queue copied to clipboard

bin/rails solid_queue:install generate queue_schema.rb instead of structure.sql when config.active_record.schema_format equal :sql

Open mdotvasylenchuk opened this issue 5 months ago • 1 comments

In my app, I use the SQL schema format. When I generate configs using solid_queue:install, it generates queue_schema.rb, which cannot be read because the app does not use the default schema format. I fixed this issue as follows:

  1. Run rails solid_queue:install
  2. Comment out config.active_record.schema_format = :sql in my app configs
  3. Run rails db:prepare
  4. Uncomment config.active_record.schema_format = :sql in my configs
  5. Run rails db:migrate:queue

After that, I got the queue_structure.sql that I needed. It feels a little bit tricky, so maybe it would be better to generate queue_structure.sql when rails solid_queue:install is run?

Ruby and gems versions: Ruby 3.3.6 Rails 8.0.2 Solid queue 1.2.1

mdotvasylenchuk avatar Aug 10 '25 15:08 mdotvasylenchuk

I've had the same issue with rails db:prepare with some of my older projects I've upgraded to newer versions of rails. I've always been perplexed why solid_queue tables are always a pain to add...this did the trick! I'll have to dig into whether my app actually needs config.active_record.schema_format = :sql...seems like the rails 8.x default is to omit this line.

Seems like there's quite a few issues open in rails / solid_queue circling around this issue. Seems like it might be a rails issue:

https://github.com/rails/rails/issues/52829 https://github.com/rails/solid_queue/issues/394 https://github.com/rails/solid_queue/issues/525

hallmatt avatar Sep 18 '25 19:09 hallmatt