Implentation for #2141

This commit is contained in:
Toks
2014-05-22 20:07:15 -04:00
parent 47f56cd19d
commit b18bb73f4b
14 changed files with 96 additions and 5 deletions

View File

@@ -0,0 +1,10 @@
class AddOtherNamesToWikiPages < ActiveRecord::Migration
def change
add_column :wiki_pages, :other_names, :text
add_column :wiki_pages, :other_names_index, :tsvector
add_column :wiki_page_versions, :other_names, :text
execute "CREATE INDEX index_wiki_pages_on_other_names_index ON wiki_pages USING GIN (other_names_index)"
execute "CREATE TRIGGER trigger_wiki_pages_on_update_for_other_names BEFORE INSERT OR UPDATE ON wiki_pages FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('other_names_index', 'public.danbooru', 'other_names')"
end
end