Merge branch 'master' into 4523-search-index
[arvados.git] / services / api / db / migrate / 20141208174553_descriptions_are_strings.rb
1 class DescriptionsAreStrings < ActiveRecord::Migration
2   def tables_with_description_column
3     %w{collections groups jobs pipeline_instances pipeline_templates}
4   end
5
6   def up
7     tables_with_description_column.each do |table|
8       change_column table.to_sym, :description, :string, :limit => 10000
9     end
10   end
11
12   def down
13     tables_with_description_column.each do |table|
14       if table != 'collections'
15         change_column table.to_sym, :description, :text
16       end
17     end
18   end
19 end