Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.