summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-03-22 02:21:39 +0000
committerRobert Speicher <robert@gitlab.com>2016-03-22 02:21:39 +0000
commit383ead5d58a0553b7700aa922ad67c41b16eadf7 (patch)
treede3d3e4e3f79b1ff9225a15bf2aa2f686589919a
parent3a78f7caa0523190acb09c5ed91eab3e19da62ab (diff)
parentcbdbbcbc4ff18da9d55265d97fc03445895f63f8 (diff)
downloadgitlab-ce-383ead5d58a0553b7700aa922ad67c41b16eadf7.tar.gz
Merge branch 'issue_12658' into 'master'
Check if index exists before adding it I got an error when updating GDK because it already exists. [ci skip] See merge request !3335
-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