X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0a8c26e596b40da6d428a5c91db0d815d13c89e4..c22958faed2e60b7277607fdee6f94976b9caf39:/db/migrate/004_user_enhancements.rb diff --git a/db/migrate/004_user_enhancements.rb b/db/migrate/004_user_enhancements.rb index 92f01bf5d..1c3bb5007 100644 --- a/db/migrate/004_user_enhancements.rb +++ b/db/migrate/004_user_enhancements.rb @@ -1,3 +1,5 @@ +require 'lib/migrate' + class UserEnhancements < ActiveRecord::Migration def self.up add_column "diary_entries", "latitude", :double @@ -13,18 +15,15 @@ class UserEnhancements < ActiveRecord::Migration add_primary_key "user_preferences", ["user_id", "k"] create_table "user_tokens", innodb_table do |t| - t.column "id", :bigint, :limit => 20, :null => false + t.column "id", :bigint_pk, :null => false t.column "user_id", :bigint, :limit => 20, :null => false t.column "token", :string, :null => false t.column "expiry", :datetime, :null => false end - add_primary_key "user_tokens", ["id"] add_index "user_tokens", ["token"], :name => "user_tokens_token_idx", :unique => true add_index "user_tokens", ["user_id"], :name => "user_tokens_user_id_idx" - change_column "user_tokens", "id", :bigint, :limit => 20, :null => false, :options => "AUTO_INCREMENT" - User.find(:all, :conditions => "token is not null").each do |user| UserToken.create(:user_id => user.id, :token => user.token, :expiry => 1.week.from_now) end