Skip to content

Change migration order for issue_user_mentions PK swap

Krasimir Angelov requested to merge 389306/issue_user_mentions/rename into master

What does this MR do and why?

In order to do Swap issue_user_mentions.note_id to bigint (!116509 - merged) we had to create a FK in advance with Prepare issue_user_mentions for bigint migration (!116614 - merged).

Unfortunately I forgot to bump the timestamp for the 20230403041917 migration, and it is earlier than the migrations from !116614 (merged).

This is not a problem for GitLab.com, as migrations from !116614 (merged) are already executed there. It is also not a problem for self-managed, as these migrations are GitLab.com only, and self-managed instances are explicitly excluded.

For development, if all migrations are executed together, we will end up with extra index and FK. This MR is aiming to reduce the chance for this by making 20230403041917, and copy it as 20230413041917. There is also extra check added, in case columns were already swapped.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports