]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/013_add_email_valid.rb
Avoid more models in old migrations
[rails.git] / db / migrate / 013_add_email_valid.rb
index 4e9112957db3a384ec1807d71f6578821ad5ffa9..b6899f3300451de83e084101f0e349b4ab221d22 100644 (file)
@@ -1,4 +1,7 @@
-class AddEmailValid < ActiveRecord::Migration[5.0]
+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