1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class AddOutputProperties < ActiveRecord::Migration[5.2]
8 "container_requests" => "container_requests_trgm_text_search_idx",
13 add_column :container_requests, :output_properties, :jsonb, default: {}
14 add_column :containers, :output_properties, :jsonb, default: {}
16 trgm_indexes.each do |model, indx|
17 execute "DROP INDEX IF EXISTS #{indx}"
18 execute "CREATE INDEX #{indx} ON #{model} USING gin((#{model.classify.constantize.full_text_trgm}) gin_trgm_ops)"
23 remove_column :container_requests, :output_properties
24 remove_column :containers, :output_properties
26 trgm_indexes.each do |model, indx|
27 execute "DROP INDEX IF EXISTS #{indx}"
28 execute "CREATE INDEX #{indx} ON #{model} USING gin((#{model.classify.constantize.full_text_trgm}) gin_trgm_ops)"