Add default value for file_store to ci_pipeline_artifacts
What does this MR do?
This MR adds a default value for our file_store
column in our new model PipelineArtifact
Why are we doing this?
This column is being updated after record creation as explained here (Coming from Carrierwave
The file.object_store is set during uploader.store! # which happens after object is inserted/updated
To avoid specifying this param during record creation, we decided to set up a default value. This is similar approach we are doing with our JobArtifact.
Migration output
$ bin/rails db:migrate
== 20200811194848 AddDefaultValueForFileStoreToPipelineArtifact: migrating ====
-- change_column_default(:ci_pipeline_artifacts, :file_store, 1)
-> 0.0030s
== 20200811194848 AddDefaultValueForFileStoreToPipelineArtifact: migrated (0.0095s)
Migration Rollback
$ bin/rails db:rollback
== 20200811194848 AddDefaultValueForFileStoreToPipelineArtifact: reverting ====
-- change_column_default(:ci_pipeline_artifacts, :file_store, nil)
-> 0.0030s
== 20200811194848 AddDefaultValueForFileStoreToPipelineArtifact: reverted (0.0076s)
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 Max Orefice