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

Screenshots or screen recordings

Not applicable — backend-only schema change.

How to set up and validate locally

  1. Run the migrations: bundle exec rails db:migrate
  2. Verify the column exists:
    ProgrammingLanguage.column_names.include?('language_id') # => true
  3. Verify the unique index exists:
    ActiveRecord::Base.connection.indexes(:programming_languages).map(&:name)
    # should include 'index_programming_languages_on_language_id'
  4. 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.

Merge request reports

Loading
Loading