Update prepare_async_index migration helper to avoid subtransaction
`safe_find_or_create_by!` creates a savepoint if already in transaction, which is usually the case for migrations. This updates the helper to use 'find_or_create_by!` instead in order to avoid subtransactions. Also changes the helper to update index definition if the record already exists and there is new definition, something we state in the method comment but were not actually doing. https://gitlab.com/gitlab-org/gitlab/-/issues/339667
Showing
Please register or sign in to comment