X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/aa1fb6dbb8c2e71b8ce8c231ae1272a2dfebd75a..48c17bbbcea8916897b2291e2b8d4eafd07c64b0:/db/migrate/004_user_enhancements.rb diff --git a/db/migrate/004_user_enhancements.rb b/db/migrate/004_user_enhancements.rb index 68c6cd1de..5d3bc4858 100644 --- a/db/migrate/004_user_enhancements.rb +++ b/db/migrate/004_user_enhancements.rb @@ -1,6 +1,4 @@ -require "migrate" - -class UserEnhancements < ActiveRecord::Migration[5.0] +class UserEnhancements < ActiveRecord::Migration[4.2] def self.up add_column "diary_entries", "latitude", :float, :limit => 53 add_column "diary_entries", "longitude", :float, :limit => 53 @@ -24,7 +22,7 @@ class UserEnhancements < ActiveRecord::Migration[5.0] add_index "user_tokens", ["token"], :name => "user_tokens_token_idx", :unique => true add_index "user_tokens", ["user_id"], :name => "user_tokens_user_id_idx" - User.where("token is not null").each do |user| + User.where.not(:token => nil).each do |user| UserToken.create(:user_id => user.id, :token => user.token, :expiry => 1.week.from_now) end