Skip to content

Add 'inherit_from_id' column to services table

Arturo Herrero requested to merge add-inherit-from-to-services into master

What does this MR do?

As part of Mass-integration at a Group and Instance Level &2137, we are moving service templates to become instance-level service configuration &2430.

This is the first iteration to deliver the MVC #213857 (closed).

The main idea is that changes in the instance-level integration are automatically propagated to the project-level integration or can override the admin settings.

This adds inherit_from_id column to services table. A project-level service can inherit the setting from a top-level service. This is a visual representation of the records (we don't have group-level integration at the moment, it will be on the following steps of the MVC).

The new column allows us:

  • Update the project-level integrations that inherit from the instance-level integration.
  • Keep track of the integrations that are overriding the admin settings.
Migration output
== 20200511115430 AddInheritFromToServices: migrating =========================
-- add_column(:services, :inherit_from_id, :bigint)
   -> 0.0012s
-- add_foreign_key(:services, :services, {:column=>:inherit_from_id, :on_delete=>:nullify})
   -> 0.0028s
== 20200511115430 AddInheritFromToServices: migrated (0.0042s) ================

== 20200511115431 AddIndexInheritFromIdToServices: migrating ==================
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:services, :inherit_from_id, {:algorithm=>:concurrently})
   -> 0.0044s
-- add_index(:services, :inherit_from_id, {:algorithm=>:concurrently})
   -> 0.0027s
== 20200511115431 AddIndexInheritFromIdToServices: migrated (0.0075s) =========

Related to #199388 (closed) #213568 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports