diff options
author | Andrew8xx8 <avk@8xx8.ru> | 2013-02-27 12:53:36 +0400 |
---|---|---|
committer | Andrew8xx8 <avk@8xx8.ru> | 2013-02-27 12:53:36 +0400 |
commit | 4a55c6987703717fd63b7884f2c9695ccac8c010 (patch) | |
tree | 024e7651a770ea621cf5130493d803b2df95787d /db | |
parent | 135418dcbf72d264a846649b95ea8e6d8a2aadcf (diff) |
Data converting migrations was wrong. Fixed
Diffstat (limited to 'db')
3 files changed, 9 insertions, 9 deletions
diff --git a/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb b/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb index 0614a5c0064..9fa96203ffd 100644 --- a/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb +++ b/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb @@ -1,14 +1,14 @@ class ConvertClosedToStateInIssue < ActiveRecord::Migration def up Issue.transaction do - Issue.where(closed: true).update_all("state = 'closed'") - Issue.where(closed: false).update_all("state = 'opened'") + Issue.where(closed: true).update_all(state: :closed) + Issue.where(closed: false).update_all(state: :opened) end end def down Issue.transaction do - Issue.where(state: :closed).update_all("closed = 1") + Issue.where(state: :closed).update_all(closed: true) end end end diff --git a/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb b/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb index 5e7477d84e1..ebb7ae585e6 100644 --- a/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb +++ b/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb @@ -1,9 +1,9 @@ class ConvertClosedToStateInMergeRequest < ActiveRecord::Migration def up MergeRequest.transaction do - MergeRequest.where(closed: true, merged: true).update_all("state = 'merged'") - MergeRequest.where(closed: true, merged: true).update_all("state = 'closed'") - MergeRequest.where(closed: false).update_all("state = 'opened'") + MergeRequest.where(closed: true, merged: true).update_all(state: :merged) + MergeRequest.where(closed: true, merged: false).update_all(state: :closed) + MergeRequest.where(closed: false).update_all(state: :opened) end end diff --git a/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb b/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb index 78096666393..1978ea89153 100644 --- a/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb +++ b/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb @@ -1,14 +1,14 @@ class ConvertClosedToStateInMilestone < ActiveRecord::Migration def up Milestone.transaction do - Milestone.where(closed: false).update_all("state = 'opened'") - Milestone.where(closed: false).update_all("state = 'active'") + Milestone.where(closed: true).update_all(state: :closed) + Milestone.where(closed: false).update_all(state: :active) end end def down Milestone.transaction do - Milestone.where(state: :closed).update_all("closed = 1") + Milestone.where(state: :closed).update_all(closed: true) end end end |