2016-06-16 23:09:34 +05:30
|
|
|
# rubocop:disable all
|
2018-12-23 12:14:25 +05:30
|
|
|
class AddUniqueIndexToNamespace < ActiveRecord::Migration[4.2]
|
2015-04-26 12:48:37 +05:30
|
|
|
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
|