]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7738 ensure remove_index is reentrant
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 14 Jun 2016 16:44:35 +0000 (18:44 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Thu, 16 Jun 2016 11:49:19 +0000 (13:49 +0200)
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1205_drop_resource_index_rid_from_resource_index.rb
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1212_drop_snapshot_project_id_from_snapshots.rb
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1226_drop_index_projects_root_id_from_projects.rb

index e44007e7046b93eaf1bde8d183051e2b83a7393a..edc42e1cfcef86723c86f8f322abc769443ca6c2 100644 (file)
 class DropResourceIndexRidFromResourceIndex < ActiveRecord::Migration
 
   def self.up
-    remove_index :resource_index, :name => 'resource_index_rid'
+    begin
+      remove_index :resource_index, :name => 'resource_index_rid'
+    rescue
+      #ignore
+    end
   end
 end
index 6b0588494bfc2190c69682da0513c66bf573d38f..3bc97373bcec0099972a042953bb12ff5e061c60 100644 (file)
 class DropSnapshotProjectIdFromSnapshots < ActiveRecord::Migration
 
   def self.up
-    remove_index :snapshots, :name => 'snapshot_project_id'
-    remove_index :snapshots, :name => 'snapshots_root_project_id'
+    begin
+      remove_index :snapshots, :name => 'snapshot_project_id'
+    rescue
+      #ignore
+    end
+    begin
+      remove_index :snapshots, :name => 'snapshots_root_project_id'
+    rescue
+      #ignore
+    end
   end
 end
index bb859a82616dbcf873d7bbe5fdf72e5e3a6eb734..038b01da20e30a75d9e06b370cd27f2dd3c97f6e 100644 (file)
 class DropIndexProjectsRootIdFromProjects < ActiveRecord::Migration
 
   def self.up
-    remove_index :projects, :name => 'projects_root_id'
+    begin
+      remove_index :projects, :name => 'projects_root_id'
+    rescue
+      #ignore
+    end
   end
 end