class AddClusterOptionsToOrganizations < ActiveRecord::Migration def change add_column :organizations, :use_cluster_as, :string add_index :organizations, :use_cluster_as, using: :btree #add_column :organizations, :use_cluster_as_suborganization, :boolean, default: false #add_column :organizations, :use_cluster_as_required_filter, :boolean, default: false #add_column :organizations, :use_cluster_as_optional_filter, :boolean, default: false end def migrate(direction) super if direction == :up execute <<-SQL -- COMMENT ON COLUMN "organizations"."use_cluster_as_suborganization" IS 'force_cluster'; -- COMMENT ON COLUMN "organizations"."use_cluster_as_required_filter" IS 'use_cluster'; -- COMMENT ON COLUMN "organizations"."use_cluster_as_optional_filter" IS 'show_cluster'; SQL end end end