Skip to content

Swap note.id to bigint for self-managed instances

Leonardo da Rosa requested to merge 417402/notes/part-1 into master

What does this MR do and why?

This MR swaps the notes.id and notes.id_convert_to_bigint columns for self-managed instances. This was already done for GitLab.com with !119705 (merged). The process is outlined here.

The timeline for GitLab.com was the following:

  1. 16.0 !119913 (merged)
  2. 16.0 !120816 (merged)
  3. 16.1 !120206 (merged)
  4. 16.1 !119705 (merged)

Since we decided to commit schema changes to structure.sql for the above MRs, we now need to consider the state of the schema from which the self-managed instance was created.

We have the following cases:

  • Instances created from 15.9 and prior – swap the columns
  • Instances created from 15.10, 15.11 – swap the columns
  • Instances created from 16.0 – swap the columns (temp column and triggers are in place)
  • Instances created from 16.1 – do not swap as the columns are already swapped, and the clean up is done (no more temp column and trigger)

How to set up and validate locally

  1. Create a new instance from each of 15.8.0, 15.9.0, 16.0.0, and 16.1.0
  2. Upgrade all instances to 16.1.2
  3. Execute the migrations from this MR
  4. Verify that migrations are executed successfully and notes table has the expected schema.

Note: We should wait to merge it after we complete the other migrations.

Related to #417402 (closed)

Edited by Leonardo da Rosa

Merge request reports