4823: Add new tests for BufferBlock, BlockManager, saving, updating. Stylistic
[arvados.git] / services / api / db / migrate / 20150123142953_full_text_search.rb
1 class FullTextSearch < ActiveRecord::Migration
2
3   def up
4     execute "CREATE INDEX collections_full_text_search_idx ON collections USING gin(#{Collection.full_text_tsvector});"
5     execute "CREATE INDEX groups_full_text_search_idx ON groups USING gin(#{Group.full_text_tsvector});"
6     execute "CREATE INDEX jobs_full_text_search_idx ON jobs USING gin(#{Job.full_text_tsvector});"
7     execute "CREATE INDEX pipeline_instances_full_text_search_idx ON pipeline_instances USING gin(#{PipelineInstance.full_text_tsvector});"
8     execute "CREATE INDEX pipeline_templates_full_text_search_idx ON pipeline_templates USING gin(#{PipelineTemplate.full_text_tsvector});"
9   end
10
11   def down
12     remove_index :pipeline_templates, :name => 'pipeline_templates_full_text_search_idx'
13     remove_index :pipeline_instances, :name => 'pipeline_instances_full_text_search_idx'
14     remove_index :jobs, :name => 'jobs_full_text_search_idx'
15     remove_index :groups, :name => 'groups_full_text_search_idx'
16     remove_index :collections, :name => 'collections_full_text_search_idx'
17   end
18 end