Fix rollback on async foreign key constraints
What does this MR do and why?
Because we've added the constraint_type
column after the table was created and there are a few migrations that use the helper already, when we rollback migrations past the one that added the column, the re-up
part will fail because it's using the latest code version which adds the filter on constraint_type
. In that case we must not apply the filter and let the migration that adds the column to populate it with the default value. We were using columns_hash
to check for column existence, but this is cached by Rails internals, so it can return true
if the column is not actually there.
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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #390651 (closed)