+require 'migrate'
+
class UserEnhancements < ActiveRecord::Migration
def self.up
add_column "diary_entries", "latitude", :double
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.find(:all, :conditions => "token is not null").each do |user|
+ User.where("token is not null").each do |user|
UserToken.create(:user_id => user.id, :token => user.token, :expiry => 1.week.from_now)
end