Do compatibility check on startup
If you're running Graphile Worker in multiple separate systems but all connecting to the same database, there's a risk that your workers may come out of sync. Normally it's a best practice for only one of these systems to run the migrations (unless you can enforce that every Graphile Worker instance is the same version of Graphile Worker) - so we should do a check on startup that
- if you're not running the migrations then the DB has to be up to date
- if you are running the migrations then ensure no newer (unknown) migrations exist in the DB
If either of these fail then we need to make a decision on whether to continue or not.
(Would be good if we can run a v1.1 worker against a v1.3 database schema without issues. Breaking database changes should require a semver major bump.)
Not sure if related https://github.com/graphile/worker/issues/299
if worker does not run migration on startup it would be good for worker to check for compatibility on startup. I'd be even happy with strict compatibility checks version ===