diff db/migrate/20120223110929_change_attachments_container_defaults.rb @ 1526:404aa68d4227

Merge from live branch
author Chris Cannam
date Thu, 11 Sep 2014 12:46:20 +0100
parents dffacf8a6908
children
line wrap: on
line diff
--- a/db/migrate/20120223110929_change_attachments_container_defaults.rb	Mon Mar 17 08:57:04 2014 +0000
+++ b/db/migrate/20120223110929_change_attachments_container_defaults.rb	Thu Sep 11 12:46:20 2014 +0100
@@ -8,8 +8,8 @@
 
     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