Add `type` column to `release_links` table
What does this MR do?
- Add
type
column torelease_links
- Add an
enum
to manage valid values fortype
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
~/src/gitlab/local-gdk/gitlab 207257-specify-asset-types-in-releases ⇡ 1m 11s
❯ rails db:migrate
== 20200527092027 AddTypeToReleaseLinks: migrating ============================
-- add_column(:release_links, :type, :integer, {:default=>0})
-> 0.0034s
== 20200527092027 AddTypeToReleaseLinks: migrated (0.0095s) ===================
Rollback
~/src/gitlab/local-gdk/gitlab 207257-specify-asset-types-in-releases* ⇡ 26s
❯ rails db:rollback STEP=1
== 20200527092027 AddTypeToReleaseLinks: reverting ============================
-- remove_column(:release_links, :type)
-> 0.0017s
== 20200527092027 AddTypeToReleaseLinks: reverted (0.0073s) ===================
Existing table rowcount
- 32476 rows on gitlab.com
/chatops run explain select id from release_links;
Index Only Scan using release_links_pkey on release_links (cost=0.29..954.18 rows=32464 width=8) (actual time=1.126..26.571 rows=32476 loops=1)
Heap Fetches: 2238
Buffers: shared hit=1619 read=181
I/O Timings: read=16.212
Planning Time: 0.805 ms
Execution Time: 28.326 ms
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
Edited by Sean Carroll