This adds an ID-less table containing one row per file, per merge request
diff. It has a column for each attribute on Gitlab::Git::Diff that is serialised
currently, with the advantage that we can easily query the attributes of this
new table.
It does not migrate existing data, so we have fallback code when the legacy
st_diffs column is present instead. For a merge request diff to be valid, it
should have at most one of:
* Rows in this new table, with the correct merge_request_diff_id.
* A non-NULL st_diffs column.
It may have neither, if the diff is empty.
This returns the ActiveRecord configuration for the current environment.
While CE doesn't use this very often, EE will use it in a few places for
the database load balancing code. I'm adding this to CE so we don't end
up with merge conflicts in this file.
This allows you to set a custom host when calling
Gitlab::Database.create_connection_pool. This is necessary for load
balancing as in this case we want to inherit all settings except for the
hostname.
We don't need to connect when requesting the name of the database
adapter. This in turn should prevent us from requesting/leaking
connections just by asking whether we're using PostgreSQL or MySQL.