2016-06-16 23:09:34 +05:30
|
|
|
# rubocop:disable all
|
2019-02-15 15:39:39 +05:30
|
|
|
class AddUsersLowerUsernameEmailIndexes < ActiveRecord::Migration[4.2]
|
2015-10-24 18:46:33 +05:30
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
return unless Gitlab::Database.postgresql?
|
|
|
|
|
|
|
|
execute 'CREATE INDEX CONCURRENTLY index_on_users_lower_username ON users (LOWER(username));'
|
|
|
|
execute 'CREATE INDEX CONCURRENTLY index_on_users_lower_email ON users (LOWER(email));'
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
return unless Gitlab::Database.postgresql?
|
|
|
|
|
|
|
|
remove_index :users, :index_on_users_lower_username
|
|
|
|
remove_index :users, :index_on_users_lower_email
|
|
|
|
end
|
|
|
|
end
|