summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-03-22 02:21:39 +0000
committerRobert Speicher <rspeicher@gmail.com>2016-03-21 22:40:56 -0400
commit534148e965ae455895d5ef9f7c61df850a377dcf (patch)
treeab3238c822061ae4f3a291a4484946e0d2e5cfd4 /db
parentc8cc1c16d1a05dd77cedcc1971614fb535beb313 (diff)
downloadgitlab-ce-534148e965ae455895d5ef9f7c61df850a377dcf.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
Diffstat (limited to 'db')
-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