message: LeftJoin conditionally
diff: @@ -50,7 +50,11 @@ const Sql /* : SqlObj */ = {
  knex('env_vars')
  .select({ pid: 'project.id' })
  .leftJoin('environment', 'env_vars.environment', '=', 'environment.id')
  - .leftJoin('project', 'environment.project', '=', 'project.id')
  + .leftJoin('project', function () {
  + this
  + .on('env_vars.project', '=', 'project.id')
  + .orOn('environment.project', '=', 'project.id')
  + })
  .where('env_vars.id', id)
  .toString(),
  };
  