Skip to content
Snippets Groups Projects
Commit ef040b13 authored by Michael Becker's avatar Michael Becker
Browse files

Add `first` & `latest` pipeline IDs to `vulnerability_occurrences`

We want to drop the `vulnerability_occurrence_pipelines` table. In
order to do this, we still need the first and latest pipeline ID
stored somewhere to support the existing feature-set

These columns should both be nullable, as continuous scanning or
alternative scan sources will not have a pipeline_id to associate.

resolves: #422382

Changelog: added
parent 1ba3f3de
No related branches found
No related tags found
No related merge requests found
# frozen_string_literal: true
class AddFirstAndLatestPipelineIdToVulnerabilityOccurrences < Gitlab::Database::Migration[2.2]
# When using the methods "add_concurrent_index" or "remove_concurrent_index"
# you must disable the use of transactions
# as these methods can not run in an existing transaction.
# When using "add_concurrent_index" or "remove_concurrent_index" methods make sure
# that either of them is the _only_ method called in the migration,
# any other changes should go in a separate migration.
# This ensures that upon failure _only_ the index creation or removing fails
# and can be retried or reverted easily.
#
# To disable transactions uncomment the following line and remove these
# comments:
# disable_ddl_transaction!
#
# Configure the `gitlab_schema` to perform data manipulation (DML).
# Visit: https://docs.gitlab.com/ee/development/database/migrations_for_multiple_databases.html
# restrict_gitlab_migration gitlab_schema: :gitlab_main
milestone '16.10'
def change
add_column :vulnerability_occurrences, :first_pipeline_id, :bigint, null: true
add_column :vulnerability_occurrences, :latest_pipeline_id, :bigint, null: true
end
end
3c817aa6647e70b9888da3b4c044bd1b63f3bfeb5a47d85debe1350675088499
\ No newline at end of file
......@@ -17291,6 +17291,8 @@ CREATE TABLE vulnerability_occurrences (
location jsonb,
detection_method smallint DEFAULT 0 NOT NULL,
uuid uuid DEFAULT '00000000-0000-0000-0000-000000000000'::uuid NOT NULL,
first_pipeline_id bigint,
latest_pipeline_id bigint,
CONSTRAINT check_4a3a60f2ba CHECK ((char_length(solution) <= 7000)),
CONSTRAINT check_ade261da6b CHECK ((char_length(description) <= 15000)),
CONSTRAINT check_f602da68dd CHECK ((char_length(cve) <= 48400))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment