Fix Migration Helpers that do not properly use the current schema
With !41907 (merged), we have removed all assumptions about using the public
schema as the schema that GitLab uses.
That means that a GitLab instance can run using any arbitrary schema or even using multiple different schemas for different setups.
We have not observed the latter use case, but it is an option that an instance could follow and that would mean that the same tables exist in multiple schemas. Or an instance may use a specific schema for GitLab and have test tables in public
with the same names as ones defined in GitLab, like for example the very commonly used users
, projects
or issues
.
All our Migration Helpers that directly query pg_class
, pg_index
, pg_constraint
, etc currently do not set the schema when fetching information about database objects, which means that those helpers can match an object with the same relname in the wrong schema.