Merge branch '15133-remove-jobs-api' refs #15133
[arvados.git] / services / api / db / migrate / 20180608123145_add_properties_to_groups.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require './db/migrate/20161213172944_full_text_search_indexes'
6
7 class AddPropertiesToGroups < ActiveRecord::Migration[4.2]
8   def up
9     add_column :groups, :properties, :jsonb, default: {}
10     ActiveRecord::Base.connection.execute("CREATE INDEX group_index_on_properties ON groups USING gin (properties);")
11     FullTextSearchIndexes.new.replace_index('groups')
12   end
13
14   def down
15     ActiveRecord::Base.connection.execute("DROP INDEX IF EXISTS group_index_on_properties")
16     remove_column :groups, :properties
17   end
18 end