Commit 2220ceea authored by mbergeron's avatar mbergeron

Add migration for the `Route.path` trigram index

parent 4de027be
# frozen_string_literal: true
class AddIndexOnRoutePathTrigram < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_routes_on_path_trigram'
disable_ddl_transaction!
def up
add_concurrent_index :routes, :path, name: INDEX_NAME, using: :gin, opclass: { path: :gin_trgm_ops }
end
def down
remove_concurrent_index_by_name(:routes, INDEX_NAME)
end
end
......@@ -10117,6 +10117,8 @@ CREATE UNIQUE INDEX index_routes_on_path ON public.routes USING btree (path);
CREATE INDEX index_routes_on_path_text_pattern_ops ON public.routes USING btree (path varchar_pattern_ops);
CREATE INDEX index_routes_on_path_trigram ON public.routes USING gin (path public.gin_trgm_ops);
CREATE UNIQUE INDEX index_routes_on_source_type_and_source_id ON public.routes USING btree (source_type, source_id);
CREATE INDEX index_saml_providers_on_group_id ON public.saml_providers USING btree (group_id);
......@@ -13150,6 +13152,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200407094005
20200407094923
20200408110856
20200408133211
20200408153842
20200408175424
20200409211607
......
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