Resolve cross DB issues in app/models/vulnerability.rb
Summary
The base vulnerability model has a scope to include projects which cannot be used when the tables are decomposed.
Further details
with_projects calls includes(:project) and allow_cross_joins_across_databases.
scope :with_projects, -> { includes(:project).allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/486246') }
Proposal
Use preload instead of includes.
Edited by Fabien Catteau