leftJoin('versioncontrol_git_item_revisions', 'vcgir', 'base.item_revision_id = vcgir.item_revision_id'); $query->fields($alias, drupal_schema_fields_sql('versioncontrol_git_item_revisions')); return $query; } }