BigW Consortium Gitlab

20130218141344_convert_closed_to_state_in_milestone.rb 467 Bytes
Newer Older
1
# rubocop:disable all
2
class ConvertClosedToStateInMilestone < ActiveRecord::Migration
3 4
  include Gitlab::Database

5
  def up
6 7
    execute "UPDATE #{table_name} SET state = 'closed' WHERE closed = #{true_value}"
    execute "UPDATE #{table_name} SET state = 'active' WHERE closed = #{false_value}"
8 9 10
  end

  def down
11 12 13 14 15 16 17
    execute "UPDATE #{table_name} SET closed = #{true_value} WHERE state = 'cloesd'"
  end

  private

  def table_name
    Milestone.table_name
18 19
  end
end