Add `milestone_id` reference to `releases`
requested to merge 235387-associate-project-releases-to-be-associated-with-group-milestones into master
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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