debian-mirror-gitlab/db/migrate/20150306023112_add_unique_index_to_namespace.rb
2018-12-23 12:14:25 +05:30

10 lines
365 B
Ruby

# rubocop:disable all
class AddUniqueIndexToNamespace < ActiveRecord::Migration[4.2]
def change
remove_index :namespaces, column: :name if index_exists?(:namespaces, :name)
remove_index :namespaces, column: :path if index_exists?(:namespaces, :path)
add_index :namespaces, :name, unique: true
add_index :namespaces, :path, unique: true
end
end