]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2962 do not fail if the index already exists
authorsimonbrandhof <simon.brandhof@gmail.com>
Wed, 2 Nov 2011 06:54:38 +0000 (07:54 +0100)
committersimonbrandhof <simon.brandhof@gmail.com>
Wed, 2 Nov 2011 06:54:38 +0000 (07:54 +0100)
sonar-server/src/main/webapp/WEB-INF/db/migrate/222_add_index_on_dependencies_project_snapshot.rb

index 77b9e26a93b8c7a3a228283eab0772fc74f557e9..eafd998f1c7a578204d6450259ddf8b58398544a 100644 (file)
 class AddIndexOnDependenciesProjectSnapshot < ActiveRecord::Migration
 
   def self.up
-    add_index('dependencies', 'project_snapshot_id', :name => 'deps_prj_sid')
+    begin
+      add_index('dependencies', 'project_snapshot_id', :name => 'deps_prj_sid')
+    rescue
+      # already exists
+    end
   end
 
 end