2016-06-09 08:39:16 -04:00
|
|
|
# rubocop:disable all
|
2018-11-13 02:27:31 -05:00
|
|
|
class NamespacesProjectsPathLowerIndexes < ActiveRecord::Migration[4.2]
|
2015-10-07 11:37:39 -04:00
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
return unless Gitlab::Database.postgresql?
|
|
|
|
|
|
|
|
execute 'CREATE INDEX CONCURRENTLY index_on_namespaces_lower_path ON namespaces (LOWER(path));'
|
|
|
|
execute 'CREATE INDEX CONCURRENTLY index_on_projects_lower_path ON projects (LOWER(path));'
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
return unless Gitlab::Database.postgresql?
|
|
|
|
|
|
|
|
remove_index :namespaces, name: :index_on_namespaces_lower_path
|
|
|
|
remove_index :projects, name: :index_on_projects_lower_path
|
|
|
|
end
|
|
|
|
end
|