migration failed on 20231207221056_finalize_backfill_uuid_conversion_column_in_vulnerability_occurrences
Customer in this internal ticket was upgrading from GitLab 16.5.2 to 16.7.3 and the post-deploy migrations failed with this error on 20231207221056_finalize_backfill_uuid_conversion_column_in_vulnerability_occurrences
StandardError: An error has occurred, all later migrations canceled:PG::UndefinedColumn: ERROR: column "uuid_convert_string_to_uuid" does not exist
LINE 1: ... WHERE "vulnerability_occurrences"."id" >= 1 AND (uuid_conve...
We were able to get them up and running on 16.7.3 by renaming that finalize migration and successfully getting through all the other remaining migrations.
Now the question is what should be done to clean up this situation. Looking back at the history of this column, I found that it was added with this MR that was originally marked for 14.2, but seems to have eventually been merged in 15.6. One of the changes in that MR was these two lines referring to this new uuid_convert_string_to_uuid column as an "ignorable column":
I'm not completely sure what an ignorable column actually is, but note that it says it's removable with 15.6, which was as far as I can tell the version that this MR eventually got merged. Also not certain what that really means.
Later, another MR came along in 16.6 that removed just those two ignorable column lines.
Finally, in 16.7, we added the migration that is causing problems, to finalize the background migration that was using this column. I didn't find the migration that removes the column, though.
What do we need to do to resolve this situation for this customer? For potential other customers? I'm not completely certain why we haven't run into this situation with other customers yet.
/cc @Quintasan