debian-mirror-gitlab/db/migrate/20151007120511_namespaces_projects_path_lower_indexes.rb

19 lines
583 B
Ruby
Raw Normal View History

# rubocop:disable all
2018-12-23 12:14:25 +05:30
class NamespacesProjectsPathLowerIndexes < 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_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