Skip to content

Remove unique index and add composite key index to Security Orchestration

Can Eldem requested to merge remove-index-add-index into master

What does this MR do?

We want to remove 1:1 relationship constrain for Security Policies. Which means one configuration repo could be assigned to many projects.

From previous MR !53743 (comment 507695528)

We don't have any data for this table at the moment. Feature is hidden behind the flag.

Migrations

Up

== 20210302155904 RemoveIndexForSecurityOrchestrationPolicy: migrating ========
-- transaction_open?()
   -> 0.0000s
-- indexes(:security_orchestration_policy_configurations)
   -> 0.0044s
-- execute("SET statement_timeout TO 0")
   -> 0.0012s
-- remove_index(:security_orchestration_policy_configurations, {:algorithm=>:concurrently, :name=>"index_sop_configs_on_security_policy_management_project_id"})
   -> 0.0085s
-- execute("RESET ALL")
   -> 0.0014s
== 20210302155904 RemoveIndexForSecurityOrchestrationPolicy: migrated (0.0174s)

== 20210302160544 AddIndexToSecurityOrchestrationPolicy: migrating ============
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:security_orchestration_policy_configurations, [:security_policy_management_project_id, :project_id], {:name=>"index_sop_configurations_project_id_policy_project_id", :algorithm=>:concurrently})
   -> 0.0025s
-- add_index(:security_orchestration_policy_configurations, [:security_policy_management_project_id, :project_id], {:name=>"index_sop_configurations_project_id_policy_project_id", :algorithm=>:concurrently})
   -> 0.0117s
== 20210302160544 AddIndexToSecurityOrchestrationPolicy: migrated (0.0157s) ===

Down

== 20210302160544 AddIndexToSecurityOrchestrationPolicy: reverting ============
-- transaction_open?()
   -> 0.0000s
-- indexes(:security_orchestration_policy_configurations)
   -> 0.0068s
-- execute("SET statement_timeout TO 0")
   -> 0.0029s
-- remove_index(:security_orchestration_policy_configurations, {:algorithm=>:concurrently, :name=>"index_sop_configurations_project_id_policy_project_id"})
   -> 0.0078s
-- execute("RESET ALL")
   -> 0.0030s
== 20210302160544 AddIndexToSecurityOrchestrationPolicy: reverted (0.0246s) ===

Conformity

Edited by Can Eldem

Merge request reports