Added migration that downcases all usernames. This should solve the "Can only login via password reset" problems

This commit is contained in:
MrZYX 2011-04-21 14:24:28 +02:00
parent 89c3e30663
commit b297648072
2 changed files with 14 additions and 1 deletions

View file

@ -0,0 +1,13 @@
class DowncaseUsernames < ActiveRecord::Migration
def self.up
execute <<SQL
UPDATE users
SET users.username = LOWER(users.username)
WHERE users.username != LOWER(users.username)
SQL
end
def self.down
raise ActiveRecord::IrreversibleMigration.new
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110406203720) do
ActiveRecord::Schema.define(:version => 20110421120744) do
create_table "aspect_memberships", :force => true do |t|
t.integer "aspect_id", :null => false