Sha256: 1a7528d2d2182a8a6addde655eb2cb4c469753dca92cfd210a0ae443e46fdfc4

Contents?: true

Size: 958 Bytes

Versions: 6

Compression:

Stored size: 958 Bytes

Contents

require 'activerecord-concurrent-index'

class AddVersionNumberToGreenFlagRulesIndices < ActiveRecord::Migration
  def up
    remove_index :green_flag_rules, [:feature_id, :group_key]
    remove_index :green_flag_rules, [:feature_id, :order_by]

    add_index_concurrently :green_flag_rules, [:feature_id, :group_key, :version_number], :unique => true, :name => 'index_green_flag_rules_on_feature_version_and_group_key'
    add_index_concurrently :green_flag_rules, [:feature_id, :order_by,  :version_number], :unique => true, :name => 'index_green_flag_rules_on_feature_version_and_order_by'
  end

  def down
    add_index_concurrently :green_flag_rules, [:feature_id, :group_key], :unique => true
    add_index_concurrently :green_flag_rules, [:feature_id, :order_by],  :unique => true

    remove_index :green_flag_rules, [:feature_id, :group_key, :version_number]
    remove_index :green_flag_rules, [:feature_id, :order_by,  :version_number]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
green_flag-0.4.0 db/migrate/20150218171852_add_version_number_to_green_flag_rules_indices.rb
green_flag-0.3.0 db/migrate/20150218171852_add_version_number_to_green_flag_rules_indices.rb
green_flag-0.2.0 db/migrate/20150218171852_add_version_number_to_green_flag_rules_indices.rb
green_flag-0.1.2 db/migrate/20150218171852_add_version_number_to_green_flag_rules_indices.rb
green_flag-0.1.1 db/migrate/20150218171852_add_version_number_to_green_flag_rules_indices.rb
green_flag-0.1.0 db/migrate/20150218171852_add_version_number_to_green_flag_rules_indices.rb