From: Sébastien Lesaint Date: Tue, 14 Jun 2016 16:44:35 +0000 (+0200) Subject: SONAR-7738 ensure remove_index is reentrant X-Git-Tag: 6.0-RC1~300 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f5ba27efa5e59cfbc9b3395b402812971f266aa8;p=sonarqube.git SONAR-7738 ensure remove_index is reentrant --- diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1205_drop_resource_index_rid_from_resource_index.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1205_drop_resource_index_rid_from_resource_index.rb index e44007e7046..edc42e1cfce 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1205_drop_resource_index_rid_from_resource_index.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1205_drop_resource_index_rid_from_resource_index.rb @@ -24,6 +24,10 @@ 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 diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1212_drop_snapshot_project_id_from_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1212_drop_snapshot_project_id_from_snapshots.rb index 6b0588494bf..3bc97373bce 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1212_drop_snapshot_project_id_from_snapshots.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1212_drop_snapshot_project_id_from_snapshots.rb @@ -24,7 +24,15 @@ 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 diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1226_drop_index_projects_root_id_from_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1226_drop_index_projects_root_id_from_projects.rb index bb859a82616..038b01da20e 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1226_drop_index_projects_root_id_from_projects.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1226_drop_index_projects_root_id_from_projects.rb @@ -24,6 +24,10 @@ 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