2015-03-06 09:39:20 -05:00
|
|
|
class AddUniqueIndexToNamespace < ActiveRecord::Migration
|
|
|
|
def change
|
2015-03-06 14:09:14 -05:00
|
|
|
remove_index :namespaces, column: :name if index_exists?(:namespaces, :name)
|
|
|
|
remove_index :namespaces, column: :path if index_exists?(:namespaces, :path)
|
2015-03-06 09:39:20 -05:00
|
|
|
|
|
|
|
add_index :namespaces, :name, unique: true
|
|
|
|
add_index :namespaces, :path, unique: true
|
|
|
|
end
|
|
|
|
end
|