X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/24b138db094e4b5e8d062c5248ee867967dc0fd7..4596fa9420621e717d90782937aa3f0bee290964:/db/migrate/013_add_email_valid.rb?ds=sidebyside diff --git a/db/migrate/013_add_email_valid.rb b/db/migrate/013_add_email_valid.rb index a45e5928a..b6899f330 100644 --- a/db/migrate/013_add_email_valid.rb +++ b/db/migrate/013_add_email_valid.rb @@ -1,4 +1,7 @@ class AddEmailValid < ActiveRecord::Migration[4.2] + class User < ActiveRecord::Base + end + def self.up add_column "users", "email_valid", :boolean, :default => false, :null => false 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