Async validate routes.namespace_id foreign key
This needs to be picked after #535946 (closed). In !181772 (diffs), we introduced a foreign key. Here we need to validate it.
Implementation guide
Follow https://docs.gitlab.com/development/database/add_foreign_key_to_existing_column/#schedule-the-fk-to-be-validated or use the following code:
class PreparesRouteNamespaceIdForeignKeyValidation < Gitlab::Database::Migration[2.3]
milestone '18.3'
FK_NAME = :fk_679ff8213d
def up
# FK to be validated synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/525273
prepare_async_foreign_key_validation :routes, :namespace_id, name: FK_NAME
end
def down
unprepare_async_foreign_key_validation :routes, :namespace_id, name: FK_NAME
end
end
Edited by Abdul Wadood