2014-09-02 18:07:02 +05:30
|
|
|
class ConvertClosedToStateInIssue < ActiveRecord::Migration
|
2016-06-02 11:05:42 +05:30
|
|
|
include Gitlab::Database
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
def up
|
2016-06-02 11:05:42 +05:30
|
|
|
execute "UPDATE #{table_name} SET state = 'closed' WHERE closed = #{true_value}"
|
|
|
|
execute "UPDATE #{table_name} SET state = 'opened' WHERE closed = #{false_value}"
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2016-06-02 11:05:42 +05:30
|
|
|
execute "UPDATE #{table_name} SET closed = #{true_value} WHERE state = 'closed'"
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def table_name
|
|
|
|
Issue.table_name
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|