Skip to content

Geo - Use Rails 6 many databases support

What does this MR do and why?

Currently, Geo manually manages additional DB connections. This results in a number of overwrites to provide this kind of support.

This MR was extracted from !70749 (closed) and is the first step towards configuring the Geo tracking database in database.yml with the following:

  1. Use Rails 6 many databases support to reduce the complexity of the current implementation;
  2. Keep Geo tracking database files (structure.sql, migrations, etc) in EE;

The next steps are:

  1. Use connects_to to make Geo models use the tracking database instead of def self.connection override in Geo::TrackingBase
  2. Deprecate custom rake geo:db:* rake tasks in favor of built-in tasks rake db:*:geo;
  3. Configure the Geo tracking database in the database.yml instead of custom database_geo.yml and deprecate it for removal in GitLab 15.0.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #340083 (closed)

Edited by Douglas Barbosa Alexandre

Merge request reports