Merge pull request #3407 from evazion/feat-tag-autocorrect

Fix #3406: Autocorrect typos during autocomplete
This commit is contained in:
Albert Yi
2017-12-13 14:33:04 -08:00
committed by GitHub
4 changed files with 51 additions and 7 deletions

View File

@@ -0,0 +1,9 @@
class AddTrigramIndexToTags < ActiveRecord::Migration
def up
execute "create index index_tags_on_name_trgm on tags using gin (name gin_trgm_ops)"
end
def down
execute "drop index index_tags_on_name_trgm"
end
end

View File

@@ -7008,6 +7008,13 @@ CREATE UNIQUE INDEX index_tags_on_name ON tags USING btree (name);
CREATE INDEX index_tags_on_name_pattern ON tags USING btree (name text_pattern_ops);
--
-- Name: index_tags_on_name_trgm; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_tags_on_name_trgm ON tags USING gin (name gin_trgm_ops);
--
-- Name: index_token_buckets_on_user_id; Type: INDEX; Schema: public; Owner: -
--
@@ -7521,3 +7528,5 @@ INSERT INTO schema_migrations (version) VALUES ('20170914200122');
INSERT INTO schema_migrations (version) VALUES ('20171106075030');
INSERT INTO schema_migrations (version) VALUES ('20171127195124');