summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Dávila <rdavila84@gmail.com>2016-03-21 21:16:37 -0500
committerRubén Dávila <rdavila84@gmail.com>2016-03-21 21:17:23 -0500
commitcbdbbcbc4ff18da9d55265d97fc03445895f63f8 (patch)
treede3d3e4e3f79b1ff9225a15bf2aa2f686589919a
parent3a78f7caa0523190acb09c5ed91eab3e19da62ab (diff)
downloadgitlab-ce-cbdbbcbc4ff18da9d55265d97fc03445895f63f8.tar.gz
Check if index exists before adding it. [ci skip]
* I got an error when updating GDK because it already exists.
-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