Skip to content

Replace runner authentication token indices with unique indices

The following indices in the ci_runners tables are not unique. We should create new unique indices and drop the old ones, taking care of nullifying any existing duplicate tokens:

gitlabhq_dblab> \d index_ci_runners_on_token
+--------+------------------------+------------+
| Column | Type                   | Definition |
|--------+------------------------+------------|
| token  | character varying(255) | token      |
+--------+------------------------+------------+
btree, for table "public.ci_runners"

gitlabhq_dblab> \d index_ci_runners_on_token_encrypted
+-----------------+-------------------+-----------------+
| Column          | Type              | Definition      |
|-----------------+-------------------+-----------------|
| token_encrypted | character varying | token_encrypted |
+-----------------+-------------------+-----------------+
btree, for table "public.ci_runners"

Proposal

  1. %15.5 - !98689 (merged) Create migration that nullifies duplicate values;
  2. %15.6 - !101734 (merged) This issue: Having ensured that no duplicates remain in the ci_runners table, create migration that replaces indices with unique indices.

Related

Edited by Pedro Pombeiro