rails / solid_queue

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

Post Install Hooks to add Updated migrations automatically? #307

Closed shettytejas closed 1 month ago

shettytejas commented 1 month ago

Just thought of it when I updated the Solid Queue gem and it started failing with some errors as there were some newer migrations. While running rails solid_queue:install:migrations fixed the problem, I was thinking can we use Gem hooks (post install) to automatically run this command if the gem has been updated? It'd streamline the process in my honest opinion, and a risk of an untested version upgrade breaking the application might reduce.

rosa commented 1 month ago

Hey @shettytejas, thanks a lot for this suggestion! I've been thinking about it and I think I'd prefer not to do that and leave that kind of change to be done explicitly by the person updating solid_queue. There's already a post-install message that warns about new migrations and other breaking changes. I've improved this to include all versions in case it wasn't clear before. Not all breaking changes are related to migrations, so I prefer that people read the UPGRADING notes after encountering an error because of the migrations.