debian-mirror-gitlab/db/migrate/20130220125544_convert_merge_status_in_merge_request.rb

21 lines
767 B
Ruby
Raw Normal View History

# rubocop:disable all
2014-09-02 18:07:02 +05:30
class ConvertMergeStatusInMergeRequest < ActiveRecord::Migration
def up
2016-06-02 11:05:42 +05:30
execute "UPDATE #{table_name} SET new_merge_status = 'unchecked' WHERE merge_status = 1"
execute "UPDATE #{table_name} SET new_merge_status = 'can_be_merged' WHERE merge_status = 2"
execute "UPDATE #{table_name} SET new_merge_status = 'cannot_be_merged' WHERE merge_status = 3"
2014-09-02 18:07:02 +05:30
end
def down
2016-06-02 11:05:42 +05:30
execute "UPDATE #{table_name} SET merge_status = 1 WHERE new_merge_status = 'unchecked'"
execute "UPDATE #{table_name} SET merge_status = 2 WHERE new_merge_status = 'can_be_merged'"
execute "UPDATE #{table_name} SET merge_status = 3 WHERE new_merge_status = 'cannot_be_merged'"
end
private
def table_name
MergeRequest.table_name
2014-09-02 18:07:02 +05:30
end
end