Commit 9303d17f authored by Mehmet Emin INAC's avatar Mehmet Emin INAC

Change the project_id index to be unique on vulnerability_statistics

parent d3306a77
# frozen_string_literal: true
class ChangeProjectIdIndexToBeUniqueOnVulnerabilityStatisticsTable < ActiveRecord::Migration[6.0]
DOWNTIME = false
INDEX_NAME = 'index_vulnerability_statistics_on_unique_project_id'
def up
remove_index :vulnerability_statistics, :project_id # rubocop:disable Migration/RemoveIndex (table is empty)
add_index :vulnerability_statistics, :project_id, name: INDEX_NAME, unique: true # rubocop:disable Migration/AddIndex (table is empty)
end
def down
remove_index :vulnerability_statistics, name: INDEX_NAME # rubocop:disable Migration/RemoveIndex (table is empty)
add_index :vulnerability_statistics, :project_id # rubocop:disable Migration/AddIndex (table is empty)
end
end
......@@ -20353,7 +20353,7 @@ CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id O
CREATE INDEX index_vulnerability_statistics_on_letter_grade ON public.vulnerability_statistics USING btree (letter_grade);
CREATE INDEX index_vulnerability_statistics_on_project_id ON public.vulnerability_statistics USING btree (project_id);
CREATE UNIQUE INDEX index_vulnerability_statistics_on_unique_project_id ON public.vulnerability_statistics USING btree (project_id);
CREATE UNIQUE INDEX index_vulnerability_user_mentions_on_note_id ON public.vulnerability_user_mentions USING btree (note_id) WHERE (note_id IS NOT NULL);
......@@ -23532,5 +23532,6 @@ COPY "schema_migrations" (version) FROM STDIN;
20200625082258
20200625190458
20200626130220
20200702123805
\.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment