bensheldon / good_job

Multithreaded, Postgres-based, Active Job backend for Ruby on Rails.
https://goodjob-demo.herokuapp.com/
MIT License
2.53k stars 190 forks source link

Warn on unapplied migrations #1361

Closed JoeSouthan closed 1 month ago

JoeSouthan commented 1 month ago

Hi,

We use dependabot and will merge patch and minor version bumps automatically when specs pass. During investigation of #1358, we noticed we had some unapplied migrations.

Would adding something that checks the latest applied migration and either warns or raises if not applied, be something that would be useful?

Prior art:

https://github.com/que-rb/que/blob/80d6067861a41766c3adb7e29b230ce93d94c8a4/lib/que/migrations.rb#L74 https://github.com/flippercloud/flipper/blob/5aa9cfda77504922f5a95c50edc3410d6bfc1986/lib/flipper/adapters/active_record.rb#L289

Happy to implement this if so!

bensheldon commented 1 month ago

There is GoodJob.migrated? which returns true/false if there are pending/unapplied migrations for GoodJob.

It's mentioned in the "Upgrading minor versions" section of the Readme, but is totally overlookable 🤗

JoeSouthan commented 1 month ago

Sorry, missed that, appreciate the push in the right direction! 🤦