Last active
August 29, 2015 13:57
-
-
Save stbenjam/9518335 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddIndexToLowerLogin < ActiveRecord::Migration | |
def up | |
execute "CREATE INDEX lower_login ON users (LOWER(login))" if ActiveRecord::Base.connection.instance_of? ActiveRecord::ConnectionAdapters::PostgreSQLAdapter | |
end | |
def down | |
execute "DROP INDEX lower_login" if ActiveRecord::Base.connection.instance_of? ActiveRecord::ConnectionAdapters::PostgreSQLAdapter; | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment