summaryrefslogtreecommitdiff
path: root/db/migrate/20160320204112_index_namespaces_on_visibility_level.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20160320204112_index_namespaces_on_visibility_level.rb')
-rw-r--r--db/migrate/20160320204112_index_namespaces_on_visibility_level.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/db/migrate/20160320204112_index_namespaces_on_visibility_level.rb b/db/migrate/20160320204112_index_namespaces_on_visibility_level.rb
index b3145443497..370b339d45c 100644
--- a/db/migrate/20160320204112_index_namespaces_on_visibility_level.rb
+++ b/db/migrate/20160320204112_index_namespaces_on_visibility_level.rb
@@ -1,5 +1,7 @@
class IndexNamespacesOnVisibilityLevel < ActiveRecord::Migration
def change
- add_index :namespaces, :visibility_level
+ unless index_exists?(:namespaces, :visibility_level)
+ add_index :namespaces, :visibility_level
+ end
end
end