X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/721dd9c27d299455b9159457a095716f797389f1..bf9430f43ecfe1f99b6b0883e5c1b442ff47333f:/db/migrate/013_add_email_valid.rb diff --git a/db/migrate/013_add_email_valid.rb b/db/migrate/013_add_email_valid.rb index a01809701..e4725b643 100644 --- a/db/migrate/013_add_email_valid.rb +++ b/db/migrate/013_add_email_valid.rb @@ -1,7 +1,10 @@ -class AddEmailValid < ActiveRecord::Migration +class AddEmailValid < ActiveRecord::Migration[4.2] + class User < ApplicationRecord + 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 + 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