13562: Add "properties" field to groups, supports subproperty query.
[arvados.git] / services / api / db / migrate / 20180608123145_add_properties_to_groups.rb
1 class AddPropertiesToGroups < ActiveRecord::Migration
2   def up
3     add_column :groups, :properties, :jsonb, default: {}
4     ActiveRecord::Base.connection.execute("CREATE INDEX group_index_on_properties ON groups USING gin (properties);")
5   end
6
7   def down
8     ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS group_index_on_properties")
9     remove_column :groups, :properties
10   end
11 end