Skip to content

Add checksum into vulnerability_remediations table

What does this MR do?

This MR introduces a new column called checksum for the vulnerability_remediations table which is already empty. This column will be used to store the checksum value of the attached diff file to identify the diff uniquely.

Related to #239177

Database Migration

Please note that there are two cops disabled in the migration as the table is already empty.

rake db:migrate

== 20201119164605 AddChecksumIntoVulnerabilityRemediations: migrating =========
-- add_column(:vulnerability_remediations, :checksum, :binary, {:null=>false, :comment=>"Stores the SHA256 checksum of the attached diff file"})
   -> 0.0042s
-- add_index(:vulnerability_remediations, :checksum, {:unique=>true})
   -> 0.0047s
== 20201119164605 AddChecksumIntoVulnerabilityRemediations: migrated (0.0090s)

rake db:migrate:down

== 20201119164605 AddChecksumIntoVulnerabilityRemediations: reverting =========
-- remove_index(:vulnerability_remediations, {:column=>:checksum})
   -> 0.0050s
-- remove_column(:vulnerability_remediations, :checksum, :binary, {:null=>false, :comment=>"Stores the SHA256 checksum of the attached diff file"})
   -> 0.0021s
== 20201119164605 AddChecksumIntoVulnerabilityRemediations: reverted (0.0089s)

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

Merge request reports