Skip to content

Add is_removed to oncall participants table

What does this MR do?

As part of https://gitlab.com/gitlab-org/gitlab/-/issues/262862, where we will be allowing participants to be removed and added from rotations, we are adding is_removed (bool).

This allows the participant objects to be 'soft-deleted'.

We need this because although a user can be removed from future shifts, we need them persisted in the rotation to show previous history.

Database changes

UP:

== 20210222030537 AddRemovedAtToOncallParticipant: migrating ==================
-- add_column(:incident_management_oncall_participants, :is_removed, :boolean, {:default=>false})
   -> 0.0018s
== 20210222030537 AddRemovedAtToOncallParticipant: migrated (0.0089s) =========

== 20210222042745 AddRemovedAtToOncallParticipantIndex: migrating =============
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:incident_management_oncall_participants, :is_removed, {:name=>"index_incident_management_oncall_participants_is_removed", :algorithm=>:concurrently})
   -> 0.0029s
-- execute("SET statement_timeout TO 0")
   -> 0.0005s
-- add_index(:incident_management_oncall_participants, :is_removed, {:name=>"index_incident_management_oncall_participants_is_removed", :algorithm=>:concurrently})
   -> 0.0032s
-- execute("RESET ALL")
   -> 0.0004s
== 20210222042745 AddRemovedAtToOncallParticipantIndex: migrated (0.0079s) ====

DOWN:

== 20210222030537 AddRemovedAtToOncallParticipant: reverting ==================
-- remove_column(:incident_management_oncall_participants, :is_removed)
   -> 0.0023s
== 20210222030537 AddRemovedAtToOncallParticipant: reverted (0.0024s) =========

== 20210222042745 AddRemovedAtToOncallParticipantIndex: reverting =============
-- transaction_open?()
   -> 0.0000s
-- indexes(:incident_management_oncall_participants)
   -> 0.0028s
-- execute("SET statement_timeout TO 0")
   -> 0.0004s
-- remove_index(:incident_management_oncall_participants, {:algorithm=>:concurrently, :name=>"index_incident_management_oncall_participants_is_removed"})
   -> 0.0027s
-- execute("RESET ALL")
   -> 0.0004s
== 20210222042745 AddRemovedAtToOncallParticipantIndex: reverted (0.0072s) ====

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #262862

Edited by Sean Arnold

Merge request reports