diff options
author | Andrew8xx8 <avk@8xx8.ru> | 2013-02-20 17:13:18 +0400 |
---|---|---|
committer | Andrew8xx8 <avk@8xx8.ru> | 2013-02-20 17:49:33 +0400 |
commit | 8ba27b7b463e6691c75528748590a1cd9b9651c9 (patch) | |
tree | d0b60d643664c40ac917377405f93fbc34883106 /db/migrate/20130220125544_convert_merge_status_in_merge_request.rb | |
parent | ba1a453ef3dddf50a2c118f4490267b19a0b2cc8 (diff) |
Migrations for convertion merge_status added
Diffstat (limited to 'db/migrate/20130220125544_convert_merge_status_in_merge_request.rb')
-rw-r--r-- | db/migrate/20130220125544_convert_merge_status_in_merge_request.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20130220125544_convert_merge_status_in_merge_request.rb b/db/migrate/20130220125544_convert_merge_status_in_merge_request.rb new file mode 100644 index 00000000000..b310b35e373 --- /dev/null +++ b/db/migrate/20130220125544_convert_merge_status_in_merge_request.rb @@ -0,0 +1,17 @@ +class ConvertMergeStatusInMergeRequest < ActiveRecord::Migration + def up + MergeRequest.transaction do + MergeRequest.where(merge_status: 1).update_all("new_merge_status = 'unchecked'") + MergeRequest.where(merge_status: 2).update_all("new_merge_status = 'can_be_merged'") + MergeRequest.where(merge_status: 3).update_all("new_merge_status = 'cannot_be_merged'") + end + end + + def down + MergeRequest.transaction do + MergeRequest.where(new_merge_status: :unchecked).update_all("merge_status = 1") + MergeRequest.where(new_merge_status: :can_be_merged).update_all("merge_status = 2") + MergeRequest.where(new_merge_status: :cannot_be_merged).update_all("merge_status = 3") + end + end +end |