Skip to content

Add `milestone_id` reference to `releases`

What does this MR do?

As part of #235387 (closed) this MR adds the milestone_id as a reference to releases.

This is an EE-only feature.

DB Migration and Rollback

As per this document

Add the output of both migrating and rolling back for all migrations into the MR description

  • Ensure the down method reverts the changes in db/structure.sql
  • Update the migration output whenever you modify the migrations during the review process

Migrate

❯ rails db:migrate
== 20200924093224 AddMilestoneIdToReleases: migrating =========================
-- column_exists?(:releases, :milestone_id)
   -> 0.0019s
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:releases, :milestone_id, {:name=>"index_releases_on_milestone_id", :algorithm=>:concurrently})
   -> 0.0019s
-- transaction_open?()
   -> 0.0000s
-- foreign_keys(:releases)
   -> 0.0052s
-- execute("SET statement_timeout TO 0")
   -> 0.0001s
-- execute("ALTER TABLE releases VALIDATE CONSTRAINT fk_bf3ae3304a;")
   -> 0.0002s
-- execute("RESET ALL")
   -> 0.0002s
== 20200924093224 AddMilestoneIdToReleases: migrated (0.0121s) ================

Rollback

❯ rails db:rollback STEP=1
== 20200924093224 AddMilestoneIdToReleases: reverting =========================
-- foreign_keys(:releases)
   -> 0.0040s
-- remove_foreign_key(:releases, :milestones)
   -> 0.0062s
-- transaction_open?()
   -> 0.0000s
-- indexes(:releases)
   -> 0.0022s
-- execute("SET statement_timeout TO 0")
   -> 0.0001s
-- remove_index(:releases, {:algorithm=>:concurrently, :name=>"index_releases_on_milestone_id"})
   -> 0.0052s
-- execute("RESET ALL")
   -> 0.0002s
-- remove_column(:releases, :milestone_id)
   -> 0.0031s
== 20200924093224 AddMilestoneIdToReleases: reverted (0.0278s) ================

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

Part of #235387 (closed)

Edited by Sean Carroll

Merge request reports