# pull\_requests

A unified table of your pull request data from various source control systems.

Group: unified

[All tables](/schema.md)

[View HTML reference](https://docs.getdx.com/schema/pull_requests/)

| Column | Type | Description | References |
| --- | --- | --- | --- |
| id | number | Unique ID for the row. |  |
| additions | number | The number of lines added in the pull request. |  |
| base\_ref | string | The name of the branch that the changes are being merged into. |  |
| bot\_authored | boolean | Boolean indicating if the user is a bot. Also known as "Machine User". |  |
| bot\_name | string | The name of the bot user that generated the PR when bot authored. |  |
| bot\_type | string | The source-specific type of bot user that generated the PR when bot authored. |  |
| closed | date | The date that the pull request was closed in the source system. |  |
| created | date | The date that the pull request was created in the source system. |  |
| deletions | number | The number of lines deleted in the pull request. |  |
| dx\_versioned\_team\_member\_id | number | The dx\_versioned\_team\_members ID of the owner's team membership when the PR was created. | [dx\_versioned\_team\_members](/schema/dx_versioned_team_members.md) |
| dx\_user\_id | number | The dx\_users ID of the user that owns the pull request. | [dx\_users](/schema/dx_users.md) |
| external\_url | string | The URL to the pull request details in the source system. |  |
| external\_id | string | The ID used by the source system. |  |
| head\_ref | string | The name of the branch that the changes are coming from. |  |
| merge\_commit\_sha | string | Merge Commit SHA from the source system |  |
| squashed\_commit\_shas | array | Full SHAs of the original source branch commits that a squash merge replaced. Used only for AI code metrics; pull request commits, commit counts, and cycle time metrics use the squash commit. Populated for Bitbucket Cloud only; null for other sources and for pull requests that have not been checked yet; empty when a pull request was checked and there are no original commits to add, because it was not squash merged or its original commits could not be recovered. |  |
| rebased\_commit\_originals | jsonb | Maps each pull request commit that was rebased while the pull request was open (for example by a merge queue, branch sync, or "Update branch") to the commit it replaced. Keys are full SHAs of current pull request commits. Each value has "original\_sha" (the first commit in the rewrite chain), "previous\_sha" (the commit it most recently replaced), and "patch\_id" (the stable git patch ID that matched them). Used only for AI code metrics, so a rebased commit can use its original commit's AI code data. Populated for GitHub and Bitbucket Cloud (merged pull requests only); null for other sources and when no rebased commits have been recorded for the pull request. |  |
| merged\_by\_user\_id | number | The dx\_users ID of the user that merged the pull request. | [dx\_users](/schema/dx_users.md) |
| merged | date | The date that the pull request was merged in the source system. |  |
| open\_to\_first\_approval | number | The time difference in seconds between a pull request being approved and ready for review. |  |
| open\_to\_first\_approval\_business\_hours | number | The time difference in seconds between a pull request being approved and ready for review during business hours (M-F 8am - 6pm). Uses the author's timezone, if linked. If not it uses the default timezone of the account. |  |
| open\_to\_first\_review | number | The time difference in seconds between the first review being submitted and the pull request ready for review. |  |
| open\_to\_first\_review\_business\_hours | number | The time difference in seconds between the first review being submitted and the pull request ready for review during business hours (M-F 8am - 6pm). the author's timezone, if linked. If not it uses the default timezone of the account. |  |
| open\_to\_merge | number | The time difference in seconds between the pull request being merged and ready for review. |  |
| open\_to\_merge\_business\_hours | number | The time difference in seconds between the pull request being merged and ready for review during business hours (M-F 8am - 6pm). the author's timezone, if linked. If not it uses the default timezone of the account. |  |
| ready\_for\_review\_at | date | The date that a pull request was marked ready for review (put in open state). |  |
| tz | string | The timezone used to calculate business hours. |  |
| weight | number | Weight of the pull request. |  |
| classification | string | Classification of the pull request. |  |
| classification\_method | string | How the classification was set. Values are 'rule' (title or branch keyword), 'ai' (DX AI), or 'user' (set manually in DX). |  |
| draft | boolean | Boolean indicating if the pull request is a draft. |  |
| reverted | boolean | Boolean indicating if the pull request was reverted. |  |
| ai\_attributes\_set\_by | string | User that set AI attributes. |  |
| ai\_attributes\_set\_at | date | Date/time when AI attributes were set. |  |
| repo\_id | number | The unique ID for the repo that owns the pull request | [repos](/schema/repos.md) |
| source | string | Source system used to select the source table references. Values are 'github', 'gitlab', 'bitbucket', 'bitbucket\_server', 'ado', 'gerrit', 'perforce', 'cursor'. |  |
| source\_table\_id | number | The unique ID for the row in the source table that this pull request originated from. | source = 'github' → [github\_pulls](/schema/github_pulls.md)<br>source = 'gitlab' → [gitlab\_merge\_requests](/schema/gitlab_merge_requests.md)<br>source = 'bitbucket' → [bitbucket\_pulls](/schema/bitbucket_pulls.md)<br>source = 'bitbucket\_server' → [bitbucket\_server\_pulls](/schema/bitbucket_server_pulls.md)<br>source = 'ado' → [ado\_pulls](/schema/ado_pulls.md)<br>source = 'gerrit' → [gerrit\_changes](/schema/gerrit_changes.md)<br>source = 'perforce' → [perforce\_reviews](/schema/perforce_reviews.md)<br>source = 'cursor' → [cursor\_origin\_pulls](/schema/cursor_origin_pulls.md) |
| source\_table\_repo\_id | number | The unique ID for the row in the source specific repository/project table that this pull request relates to. | source = 'github' → [github\_repositories](/schema/github_repositories.md)<br>source = 'gitlab' → [gitlab\_projects](/schema/gitlab_projects.md)<br>source = 'bitbucket' → [bitbucket\_repositories](/schema/bitbucket_repositories.md)<br>source = 'bitbucket\_server' → [bitbucket\_server\_repositories](/schema/bitbucket_server_repositories.md)<br>source = 'ado' → [ado\_repositories](/schema/ado_repositories.md)<br>source = 'gerrit' → [gerrit\_projects](/schema/gerrit_projects.md)<br>source = 'perforce' → [perforce\_repositories](/schema/perforce_repositories.md)<br>source = 'cursor' → [cursor\_origin\_repositories](/schema/cursor_origin_repositories.md) |
| title | string | The title or summary of the pull request |  |
| updated | date | The date that the pull request was last updated in the source system. |  |
| deleted | boolean | Boolean indicating if the pull request has been deleted. |  |
| max\_merge\_to\_deploy | number | Maximum time from pull request merge to deployment, in seconds. |  |
| max\_open\_to\_deploy | number | Maximum time from the pull request becoming ready for review (or its creation when unavailable) to deployment, in seconds. |  |
| max\_deployed\_at | date | Latest deployment timestamp for the pull request. |  |
| pct\_ai | number | Percentage of the pull request attributed to AI code. |  |
| row\_created\_at (DX internal) | date | When DX created this database row. |  |
| row\_updated\_at (DX internal) | date | When DX last updated this database row. |  |
