Sha256: 4022bae6ac648957a4d997f24b66e7ecdd03b28246927feddba420ed1abcbcd2

Contents?: true

Size: 496 Bytes

Versions: 6

Compression:

Stored size: 496 Bytes

Contents

class RequireOrderingForGreenFlagRules < ActiveRecord::Migration
  def up
    change_column :green_flag_rules, :order_by, :integer, null: false
    remove_index :green_flag_rules, [:feature_id, :order_by]
    add_index :green_flag_rules, [:feature_id, :order_by], :unique => true
  end

  def down
    remove_index :green_flag_rules, [:feature_id, :order_by]
    add_index :green_flag_rules, [:feature_id, :order_by]
    change_column :green_flag_rules, :order_by, :integer, null: true
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
green_flag-0.4.0 db/migrate/20140514202337_require_ordering_for_green_flag_rules.rb
green_flag-0.3.0 db/migrate/20140514202337_require_ordering_for_green_flag_rules.rb
green_flag-0.2.0 db/migrate/20140514202337_require_ordering_for_green_flag_rules.rb
green_flag-0.1.2 db/migrate/20140514202337_require_ordering_for_green_flag_rules.rb
green_flag-0.1.1 db/migrate/20140514202337_require_ordering_for_green_flag_rules.rb
green_flag-0.1.0 db/migrate/20140514202337_require_ordering_for_green_flag_rules.rb