]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/013_add_email_valid.rb
Fixing boo-boo in r11802 - but you can assign integers to booleans on all dbs
[rails.git] / db / migrate / 013_add_email_valid.rb
index b8af4bf6ad5e7b6c519ba19c2b0f1228d95cd227..a0180970109a8ea212b013c359e75f3832009080 100644 (file)
@@ -1,7 +1,7 @@
 class AddEmailValid < ActiveRecord::Migration
   def self.up
     add_column "users", "email_valid", :boolean, :default => false, :null => false
-    User.update_all("email_valid = active")
+    User.update_all("email_valid = (active != 0)") #email_valid is :boolean, but active is :integer. "email_valid = active" (see r11802 or earlier) will fail for stricter dbs than mysql
   end
 
   def self.down