gitlab-org/gitlab
Data models
A non-exhaustive map of the most-touched tables. The schema is in db/structure.sql (~24 MB) and db/docs/.
Core
| Table | Notes |
|---|---|
users |
All identities, including bots and ghosts. |
namespaces |
STI: User namespace, Group, ProjectNamespace. |
projects |
Repository, CI config, integrations attach here. |
members |
Project / group membership rows. |
routes |
Polymorphic path → resource mapping (project routing). |
personal_access_tokens |
API tokens issued by users. |
application_settings |
Single-row admin settings. |
Issuables and discussions
| Table | Notes |
|---|---|
issues, merge_requests |
Two flavors of issuable. |
work_items_widget_* |
Widgets attached to work items. |
notes |
Comments — polymorphic via noteable_type. |
discussions |
A grouping of notes (used for diff threads). |
events |
Activity feed entries. |
award_emoji |
Reactions. |
todos |
Per-user todo inbox. |
subscriptions |
Issue/MR/label subscriptions. |
internal_ids |
Per-parent IID counters. |
CI
| Table | Notes |
|---|---|
ci_pipelines |
Pipeline runs. |
ci_builds |
Jobs (legacy table name). |
ci_stages |
Stages within a pipeline. |
ci_runners, ci_runner_machines |
Runners and their executors. |
ci_job_artifacts |
Build artifacts metadata. |
ci_variables, ci_group_variables |
Variables. |
ci_pipeline_schedules |
Cron triggers. |
ci_secure_files |
Files uploaded for CI. |
These live in the ci decomposed database.
Repository / SCM
| Table | Notes |
|---|---|
protected_branches, protected_tags |
Branch / tag rules. |
tags, branches |
Cached refs (some are computed from Gitaly). |
merge_request_diffs |
Snapshotted MR diffs. |
merge_request_diff_files |
Per-file diff data. |
pool_repositories |
Object pools for forks. |
Packages
| Table | Notes |
|---|---|
packages_packages |
Package versions across all formats. |
packages_package_files |
Bytes pointer (object storage). |
container_repositories |
Container Registry repositories. |
dependency_proxy_* |
Dependency Proxy cache. |
Security
| Table | Notes |
|---|---|
vulnerabilities, vulnerability_findings |
Vulnerability records. |
vulnerability_occurrences |
Per-scanner occurrences. |
vulnerability_state_transitions |
Workflow audit. |
dast_*, sast_*, secret_detection_* |
Per-scanner config. |
These live in the sec decomposed database.
Geo (EE)
| Table | Notes |
|---|---|
geo_*_registry |
Per-resource replication state. |
In a separate Geo tracking DB.
Observability
| Table | Notes |
|---|---|
audit_events |
Partitioned by month. |
application_setting_terms |
Terms of use acceptance. |
error_tracking_errors, error_tracking_events |
Sentry-style error tracking. |
Search
| Table | Notes |
|---|---|
search_indices, search_zoekt_* |
Zoekt deployment metadata. |
ai_* (some Active Context) |
Active Context state. |
ClickHouse tables
The ClickHouse cluster has its own schema — not in db/structure.sql. See db/clickhouse/migrate/ for migrations. Major tables include event-store ingest, audit events, and CI analytics.
Naming and conventions
- Singular models (
User,Project); plural tables (users,projects). - Foreign keys match
<model>_id. - Soft-delete is rare; most deletes are hard with cascading workers.
- Decomposed databases (
main,ci,sec) — cross-DB joins are forbidden at runtime.
Related
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.