GitHub code hosting database schema

How a code hosting platform models its data: users and organisations, repositories, refs and commits, issues and pull requests sharing one number sequence, reviews with comments anchored to a file and line, labels, milestones and workflow runs.

Github ER diagram

GitHub code hosting database schema n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 11 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 users idBIGINT loginVARCHAR emailVARCHAR display_nameVARCHAR avatar_urlTEXT is_site_adminBOOLEAN created_atTIMESTAMP suspended_atTIMESTAMP organizations idBIGINT loginVARCHAR display_nameVARCHAR owner_user_idBIGINT billing_emailVARCHAR created_atTIMESTAMP repositories idBIGINT owner_user_idBIGINT owner_org_idBIGINT parent_repository…BIGINT nameVARCHAR descriptionVARCHAR default_branchVARCHAR visibilityVARCHAR is_archivedBOOLEAN issue_counterINTEGER created_atTIMESTAMP pushed_atTIMESTAMP git_refs idBIGINT repository_idBIGINT nameVARCHAR target_shaCHAR ref_typeVARCHAR is_protectedBOOLEAN updated_atTIMESTAMP commits idBIGINT repository_idBIGINT shaCHAR parent_shasVARCHAR author_user_idBIGINT author_nameVARCHAR author_emailVARCHAR messageTEXT authored_atTIMESTAMP committed_atTIMESTAMP additionsINTEGER deletionsINTEGER milestones idBIGINT repository_idBIGINT numberINTEGER titleVARCHAR descriptionTEXT stateVARCHAR due_onDATE closed_atTIMESTAMP issues idBIGINT repository_idBIGINT numberINTEGER is_pull_requestBOOLEAN author_idBIGINT milestone_idBIGINT titleVARCHAR bodyTEXT stateVARCHAR state_reasonVARCHAR comment_countINTEGER created_atTIMESTAMP updated_atTIMESTAMP closed_atTIMESTAMP pull_requests issue_idBIGINT head_repository_idBIGINT head_ref_nameVARCHAR head_shaCHAR base_ref_nameVARCHAR base_shaCHAR merge_commit_shaCHAR merged_by_idBIGINT merge_methodVARCHAR is_draftBOOLEAN changed_filesINTEGER merged_atTIMESTAMP labels idBIGINT repository_idBIGINT nameVARCHAR colorCHAR descriptionVARCHAR issue_labels issue_idBIGINT label_idBIGINT applied_atTIMESTAMP reviews idBIGINT pull_request_idBIGINT reviewer_idBIGINT commit_shaCHAR stateVARCHAR bodyTEXT submitted_atTIMESTAMP dismissed_atTIMESTAMP review_comments idBIGINT pull_request_idBIGINT review_idBIGINT in_reply_to_idBIGINT author_idBIGINT pathVARCHAR commit_shaCHAR original_commit_s…CHAR diff_sideVARCHAR lineINTEGER start_lineINTEGER original_lineINTEGER diff_hunkTEXT is_outdatedBOOLEAN is_resolvedBOOLEAN bodyTEXT created_atTIMESTAMP updated_atTIMESTAMP workflow_runs idBIGINT repository_idBIGINT triggering_user_idBIGINT workflow_pathVARCHAR run_numberINTEGER run_attemptINTEGER eventVARCHAR head_shaCHAR head_branchVARCHAR statusVARCHAR conclusionVARCHAR started_atTIMESTAMP completed_atTIMESTAMP created_atTIMESTAMP workflow_jobs idBIGINT run_idBIGINT nameVARCHAR run_attemptINTEGER statusVARCHAR conclusionVARCHAR runner_nameVARCHAR runner_labelsVARCHAR started_atTIMESTAMP completed_atTIMESTAMP

Related database schemas