bin/rails solid_queue:install generate queue_schema.rb instead of structure.sql when config.active_record.schema_format equal :sql
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:
- Run rails solid_queue:install
- Comment out config.active_record.schema_format = :sql in my app configs
- Run rails db:prepare
- Uncomment config.active_record.schema_format = :sql in my configs
- 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
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