Activate (and deactivate) maintenance mode only if there are pending migrations