summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2016-11-28 06:21:11 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2016-11-28 06:21:11 +0000
commit28b20270b4c2ef2fded225f2fba4e358753773e9 (patch)
treec68a6d5117cba997c7b69348d6fd81afd3413bce /db
parent65e08b259d6506a2303a642844dc65a4b9654463 (diff)
downloadredmine-28b20270b4c2ef2fded225f2fba4e358753773e9.tar.gz
redmine-28b20270b4c2ef2fded225f2fba4e358753773e9.zip
use symbol instead of string for 'position' in db migrate (#24013)
git-svn-id: http://svn.redmine.org/redmine/trunk@16009 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db')
-rw-r--r--db/migrate/072_add_enumerations_position.rb2
-rw-r--r--db/migrate/078_add_custom_fields_position.rb2
-rw-r--r--db/migrate/20141029181824_remove_issue_statuses_is_default.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/db/migrate/072_add_enumerations_position.rb b/db/migrate/072_add_enumerations_position.rb
index cf5646cf9..2834abef1 100644
--- a/db/migrate/072_add_enumerations_position.rb
+++ b/db/migrate/072_add_enumerations_position.rb
@@ -4,7 +4,7 @@ class AddEnumerationsPosition < ActiveRecord::Migration
Enumeration.all.group_by(&:opt).each do |opt, enums|
enums.each_with_index do |enum, i|
# do not call model callbacks
- Enumeration.where({:id => enum.id}).update_all("position = #{i+1}")
+ Enumeration.where({:id => enum.id}).update_all(:position => (i+1))
end
end
end
diff --git a/db/migrate/078_add_custom_fields_position.rb b/db/migrate/078_add_custom_fields_position.rb
index ef940eb02..a03db4618 100644
--- a/db/migrate/078_add_custom_fields_position.rb
+++ b/db/migrate/078_add_custom_fields_position.rb
@@ -4,7 +4,7 @@ class AddCustomFieldsPosition < ActiveRecord::Migration
CustomField.all.group_by(&:type).each do |t, fields|
fields.each_with_index do |field, i|
# do not call model callbacks
- CustomField.where({:id => field.id}).update_all("position = #{i+1}")
+ CustomField.where({:id => field.id}).update_all(:position => (i+1))
end
end
end
diff --git a/db/migrate/20141029181824_remove_issue_statuses_is_default.rb b/db/migrate/20141029181824_remove_issue_statuses_is_default.rb
index 62785d37a..c5c813d62 100644
--- a/db/migrate/20141029181824_remove_issue_statuses_is_default.rb
+++ b/db/migrate/20141029181824_remove_issue_statuses_is_default.rb
@@ -6,7 +6,7 @@ class RemoveIssueStatusesIsDefault < ActiveRecord::Migration
def down
add_column :issue_statuses, :is_default, :boolean, :null => false, :default => false
# Restores the first status as default
- default_status_id = IssueStatus.order("position").pluck(:id).first
+ default_status_id = IssueStatus.order(:position).pluck(:id).first
IssueStatus.where(:id => default_status_id).update_all(:is_default => true)
end
end