Fix programming_languages table to use globally stable identifier

Problem statement

Without converting this to a universal languageID, the customer project language statistics and Analytics will be corrupted after a move.

The programming_languages table is a table with id, name, and color columns. The table has a unique index on the name column. The real data for this table comes from Gitaly.

The id column makes this table inconsistent, and this inconsistent ID column is persisted in other tables (repository_languages).

Proposal

  1. Add a language_id column in programming_languages table, bigint - !231864 (merged)
  2. Update the Gitaly::CommitService to return the returned response l.language_id. - !230678 (merged)
  3. Update, or create the row in programming_languages with this language_id - !232748 (merged)
  4. All referencing tables will be switched to refer to the language_id column instead.
    • repository_languages
    • analytics_language_trend_repository_languages - this table was dropped (see #597908 (closed))
  5. Switch to use the language_id as the primary key of the programming_languages table.
  6. Drop the id column.
Edited by Vasilii Iakliushin