gitlab-org--gitlab-foss/db/migrate/20150306023112_add_unique_index_to_namespace.rb
2015-03-10 20:09:34 +02:00

9 lines
338 B
Ruby

class AddUniqueIndexToNamespace < ActiveRecord::Migration
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