make sure apply sql has the correct env vars set