X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/aa1fb6dbb8c2e71b8ce8c231ae1272a2dfebd75a..ea3760f94d9d74d3aaa8492182b9e1a15ec1effa:/db/migrate/013_add_email_valid.rb?ds=inline diff --git a/db/migrate/013_add_email_valid.rb b/db/migrate/013_add_email_valid.rb index 4e9112957..e4725b643 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[5.0] +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