Commit bda826eb authored by Pavel Shutsin's avatar Pavel Shutsin

Fix security scan query timeout

Changelog: other
parent 8ea9b0e2
# frozen_string_literal: true
class AddSecurityScansCreatedAtIndex < ActiveRecord::Migration[6.1]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
INDEX_NAME = 'index_security_scans_on_created_at'
def up
add_concurrent_index(:security_scans, :created_at, name: INDEX_NAME)
end
def down
remove_concurrent_index_by_name(:security_scans, INDEX_NAME)
end
end
18f7a9a0e9f0b331028951adf2bf6ca9a9fc4a62872f5307ee9d74761ae06deb
\ No newline at end of file
...@@ -24798,6 +24798,8 @@ CREATE INDEX index_security_findings_on_severity ON security_findings USING btre ...@@ -24798,6 +24798,8 @@ CREATE INDEX index_security_findings_on_severity ON security_findings USING btre
CREATE UNIQUE INDEX index_security_findings_on_uuid_and_scan_id ON security_findings USING btree (uuid, scan_id); CREATE UNIQUE INDEX index_security_findings_on_uuid_and_scan_id ON security_findings USING btree (uuid, scan_id);
CREATE INDEX index_security_scans_on_created_at ON security_scans USING btree (created_at);
CREATE INDEX index_security_scans_on_date_created_at_and_id ON security_scans USING btree (date(timezone('UTC'::text, created_at)), id); CREATE INDEX index_security_scans_on_date_created_at_and_id ON security_scans USING btree (date(timezone('UTC'::text, created_at)), id);
CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events USING btree (environment_id); CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events USING btree (environment_id);
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