Loading
Add language_id column to programming_languages table
What does this MR do and why?
Contributes to #519895 (closed)
Problem
The programming_languages table uses an auto-increment id
that is inconsistent across GitLab Cells. Gitaly returns a
globally stable language_id but there is no column to store
it yet.
Solution
Add a nullable language_id bigint column to the
programming_languages table and a unique index on it.
This prepares for later steps that will populate the column
from the Gitaly CommitLanguagesResponse and eventually
switch the primary key.
References
- Issue: #519895 (closed)
- Gitaly MR that added
language_idto the protobuf response: gitaly!8068 (merged) - Rails MR exposing
language_idfrom Gitaly (step 2): !230678 (merged)
Screenshots or screen recordings
Not applicable — backend-only schema change.
How to set up and validate locally
- Run the migrations:
bundle exec rails db:migrate - Verify the column exists:
ProgrammingLanguage.column_names.include?('language_id') # => true - Verify the unique index exists:
ActiveRecord::Base.connection.indexes(:programming_languages).map(&:name) # should include 'index_programming_languages_on_language_id' - Verify rollback:
bundle exec rails db:rollback STEP=2
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.