Commit d5b0bcaf authored by João Cunha's avatar João Cunha

Add index snippets on project_id and title

This index will support the query we use for matching snippets during
the GitLab Migration feature.

Changelog: added
parent 61786842
# frozen_string_literal: true
class AddIndexSnippetsOnProjectIdAndTitle < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
INDEX_NAME = 'index_snippets_on_project_id_and_title'
def up
add_concurrent_index :snippets, [:project_id, :title], name: INDEX_NAME
end
def down
remove_concurrent_index_by_name :snippets, name: INDEX_NAME
end
end
6a3591e70ddd6573ad68360c1a8774ef61e7812ce831c75066baec5754e2bd76
\ No newline at end of file
......@@ -27422,6 +27422,8 @@ CREATE INDEX index_snippets_on_id_and_created_at ON snippets USING btree (id, cr
CREATE INDEX index_snippets_on_id_and_type ON snippets USING btree (id, type);
CREATE INDEX index_snippets_on_project_id_and_title ON snippets USING btree (project_id, title);
CREATE INDEX index_snippets_on_project_id_and_visibility_level ON snippets USING btree (project_id, visibility_level);
CREATE INDEX index_snippets_on_title_trigram ON snippets USING gin (title gin_trgm_ops);
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