Skip to content

Commit

Permalink
Modify migration to use single_access_token properly. Specs still not…
Browse files Browse the repository at this point in the history
… passing. [#19]
  • Loading branch information
marnen committed Oct 13, 2009
1 parent 70c99d3 commit c225a95
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions db/migrate/20091012223503_transition_to_authlogic.rb
Expand Up @@ -5,6 +5,10 @@ def self.up
change_column :users, :salt, :string, :limit => 128, :null => false, :default => ""
rename_column :users, :salt, :password_salt

remove_index :users, :feed_key
rename_column :users, :feed_key, :single_access_token
add_index :users, :single_access_token

add_column :users, :login_count, :integer, :null => false, :default => 0
add_column :users, :failed_login_count, :integer, :null => false, :default => 0
add_column :users, :last_request_at, :datetime
Expand All @@ -14,7 +18,6 @@ def self.up
add_column :users, :last_login_ip, :string

add_column :users, :persistence_token, :string, :null => false, :default => ''
add_column :users, :single_access_token, :string, :null => false, :default => ''
add_column :users, :perishable_token, :string, :null => false, :default => ''
add_index :users, :perishable_token

Expand All @@ -33,14 +36,19 @@ def self.down
add_column :users, :remember_token, :string
add_column :users, :remember_token_expires_at, :timestamp

remove_column :users, :active

remove_column :users, :perishable_token
remove_column :users, :single_access_token
remove_column :users, :persistence_token

[:login_count, :failed_login_count, :last_request_at, :current_login_at, :last_login_at, :current_login_ip, :last_login_ip].each do |col|
remove_column :users, col
end

remove_index :users, :single_access_token
rename_column :users, :single_access_token, :feed_key
add_index :users, :feed_key

rename_column :users, :password_salt, :salt
change_column :users, :crypted_password, :string, :limit => 40, :null => false, :default => ""
change_column :users, :salt, :string, :limit => 40, :null => false, :default => ""
Expand Down

0 comments on commit c225a95

Please sign in to comment.