Skip to content

Comments

Support :sql schema format in the install generator#708

Open
ringe wants to merge 2 commits intorails:mainfrom
ringe:fix-install-generator-schema-format
Open

Support :sql schema format in the install generator#708
ringe wants to merge 2 commits intorails:mainfrom
ringe:fix-install-generator-schema-format

Conversation

@ringe
Copy link

@ringe ringe commented Jan 27, 2026

This patch will make it easier to use solid_queue when the app is set up with :sql schema format because of unsupported SQL features.

Fixes #621

  • Install generator uses schema or structure template based on active_record.schema_format
  • Added queue_structure.sql template based on the existing queue_schema.rb template

@ringe
Copy link
Author

ringe commented Jan 27, 2026

I've built a script to run any of the "Tests (3.1, sqlite, rails_7_2)" approaches.

The failing tests are not failing because of my patch here, the tests are just not very stable.
I re-run the tests in question and they pass. Re-run the whole file, complete pass.
Sometimes I get skips.

Can I do anything to make the tests more stable?

@rosa
Copy link
Member

rosa commented Jan 27, 2026

Thank you!

The failing tests are not failing because of my patch here, the tests are just not very stable.
I re-run the tests in question and they pass. Re-run the whole file, complete pass.
Sometimes I get skips.
Can I do anything to make the tests more stable?

Hey! Yes, out of the 3, only one test was actually failing, and that's a flaky test already on my radar. The other two failures were Docker container starting errors from GitHub actions, it seems.

I'll try to review this this week, but I'm not sure if I'll get to it 🤞

@rosa
Copy link
Member

rosa commented Feb 18, 2026

Sorry for the delay @ringe, I couldn't get to this until this week.

Unfortunately, this is not going to work as it is, because your structure.sql file is not compatible with PostgreSQL. The advantage of queue_schema.rb is that it is RDBMS-agnostic; Rails makes sure to generate the proper SQL statements to use in your DB. A structure.sql file is going to change based on multiple external factors.

I think to support this, the structure.sql file can't be provided as a template; it should be generated as part of the install based on the app's configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants