summaryrefslogtreecommitdiffstats
path: root/db/migrate/20120223110929_change_attachments_container_defaults.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-07 10:03:11 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-07 10:03:11 +0000
commit0bc3ef5014dd8611fb1771061b57529bf4920e8b (patch)
tree22195b5e912bb9e6d518e1117eac6b6a614a9ca2 /db/migrate/20120223110929_change_attachments_container_defaults.rb
parenta5f028a2424e2e234081b6a84c496fb6c563ee9c (diff)
downloadredmine-0bc3ef5014dd8611fb1771061b57529bf4920e8b.tar.gz
redmine-0bc3ef5014dd8611fb1771061b57529bf4920e8b.zip
Rails4: replace deprecated Relation#update_all at db migrations
git-svn-id: http://svn.redmine.org/redmine/trunk@12488 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate/20120223110929_change_attachments_container_defaults.rb')
-rw-r--r--db/migrate/20120223110929_change_attachments_container_defaults.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/db/migrate/20120223110929_change_attachments_container_defaults.rb b/db/migrate/20120223110929_change_attachments_container_defaults.rb
index f959f4c33..be720aafa 100644
--- a/db/migrate/20120223110929_change_attachments_container_defaults.rb
+++ b/db/migrate/20120223110929_change_attachments_container_defaults.rb
@@ -8,8 +8,8 @@ class ChangeAttachmentsContainerDefaults < ActiveRecord::Migration
change_column :attachments, :container_id, :integer, :default => nil, :null => true
change_column :attachments, :container_type, :string, :limit => 30, :default => nil, :null => true
- Attachment.update_all "container_id = NULL", "container_id = 0"
- Attachment.update_all "container_type = NULL", "container_type = ''"
+ Attachment.where("container_id = 0").update_all("container_id = NULL")
+ Attachment.where("container_type = ''").update_all("container_type = NULL")
add_index :attachments, [:container_id, :container_type]
end