aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-05 23:21:30 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-06 15:44:31 +0200
commit03ef0355ef27e7dc0a69de9f69fa6103abe01f0e (patch)
treede7599c77da111fa79cdadea1d3e12ab4c9a60d2 /server
parente816a69c28603e73673e50295bc0d3a88f01081d (diff)
downloadsonarqube-03ef0355ef27e7dc0a69de9f69fa6103abe01f0e.tar.gz
sonarqube-03ef0355ef27e7dc0a69de9f69fa6103abe01f0e.zip
SONAR-7780 Drop column PROJECT_MEASURES.SNAPSHOT_ID
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml127
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml2
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml3
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml3
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/filters/FilterExecutorTest/views.xml56
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml3
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml5
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml8
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml3
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1270_drop_indices_on_tree_columns_of_snapshots.rb (renamed from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1270_drop_tree_columns_from_snapshots.rb)3
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1271_drop_tree_columns_from_snapshots.rb30
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1272_drop_index_on_snapshot_id_of_measures.rb34
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1273_drop_snapshot_id_column_from_measures.rb30
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1274_add_index_on_analysis_uuid_of_measures.rb29
14 files changed, 128 insertions, 208 deletions
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml
deleted file mode 100644
index eb57c249d23..00000000000
--- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<dataset>
-
- <metrics id="1"
- name="ncloc"
- short_name="ncloc"
- VAL_TYPE="INT"
- enabled="true"/>
- <metrics id="2"
- name="coverage"
- short_name="coverage"
- VAL_TYPE="PERCENT"
- enabled="true"/>
- <metrics id="3"
- name="file_complexity"
- short_name="file_complexity"
- VAL_TYPE="FLOAT"
- enabled="true"/>
- <metrics id="4"
- name="test_execution_time"
- short_name="test_execution_time"
- VAL_TYPE="MILLISEC"
- enabled="true"/>
-
- <rules id="30"
- name="Check Header"
- plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
- plugin_config_key="Checker/Treewalker/HeaderCheck"
- plugin_name="checkstyle"/>
-
- <rules id="31"
- name="Equals Avoid Null"
- plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck"
- plugin_config_key="Checker/TreeWalker/EqualsAvoidNull"
- plugin_name="checkstyle"/>
-
- <!-- project -->
- <projects uuid="ABCD"
- uuid_path="NOT_USED"
- project_uuid="ABCD"
- module_uuid="[null]"
- module_uuid_path=".ABCD."
- enabled="true"
- id="1"
- scope="PRJ"
- qualifier="TRK"
- kee="PROJECT_KEY"
- name="project"
- root_id="[null]"/>
-
- <!-- directory -->
- <projects uuid="BCDE"
- uuid_path="NOT_USED"
- project_uuid="ABCD"
- module_uuid="ABCD"
- module_uuid_path=".ABCD."
- enabled="true"
- id="2"
- scope="DIR"
- qualifier="PAC"
- kee="DIRECTORY_KEY"
- name="org.foo"
- root_id="1"/>
-
- <!-- snapshots -->
- <snapshots id="1000"
- uuid="u1000"
- project_id="1"
- root_project_id="1"
-
- scope="PRJ"
- qualifier="TRK"
- created_at="1225544280000"
- build_date="1225544280000"
- status="P"
- islast="false"/>
- <snapshots id="1001"
- uuid="u1001"
- project_id="2"
- root_project_id="1"
- root_snapshot_id="1000"
- scope="DIR"
- qualifier="PAC"
- created_at="1225544280000"
- build_date="1225544280000"
- status="P"
- islast="false"/>
-
-
- <!-- project measures -->
- <project_measures id="1"
- VALUE="60"
- METRIC_ID="1"
- SNAPSHOT_ID="1000"
- analysis_uuid="u1000"
- text_value="[null]"
- project_id="[null]"
- person_id="[null]"/>
-
- <project_measures id="2"
- VALUE="80"
- METRIC_ID="2"
- SNAPSHOT_ID="1000"
- analysis_uuid="u1000"
- text_value="[null]"
- project_id="[null]"
- person_id="[null]"/>
-
- <!-- package measures -->
- <project_measures id="3"
- VALUE="20"
- METRIC_ID="1"
- SNAPSHOT_ID="1001"
- analysis_uuid="u1000"
- text_value="[null]"
- project_id="[null]"
- person_id="[null]"/>
-
- <project_measures id="4"
- VALUE="70"
- METRIC_ID="2"
- SNAPSHOT_ID="1001"
- analysis_uuid="u1000"
- text_value="[null]"
- project_id="[null]"
- person_id="[null]"/>
-
-</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml
index f788fbd156e..6c9a20a3947 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml
@@ -1,7 +1,6 @@
<dataset>
<project_measures id="1"
- snapshot_id="1000"
analysis_uuid="u1000"
metric_id="10"
value="[null]"
@@ -14,7 +13,6 @@
variation_value_5="[null]"/>
<project_measures id="2"
- snapshot_id="1000"
analysis_uuid="u1000"
metric_id="10"
value="[null]"
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml
index 3006765aa14..bebfa323a9f 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml
@@ -1,6 +1,5 @@
<dataset>
- <project_measures snapshot_id="1000"
- analysis_uuid="u1000"
+ <project_measures analysis_uuid="u1000"
metric_id="10"
value="6.0"
project_id="[null]"
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml
index 1cacaf4f14d..2ade50f852e 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml
@@ -1,6 +1,5 @@
<dataset>
- <project_measures snapshot_id="1000"
- analysis_uuid="u1000"
+ <project_measures analysis_uuid="u1000"
metric_id="10"
value="3.0"
project_id="[null]"
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/filters/FilterExecutorTest/views.xml b/server/sonar-server/src/test/resources/org/sonar/server/filters/FilterExecutorTest/views.xml
deleted file mode 100644
index 329e12e12e1..00000000000
--- a/server/sonar-server/src/test/resources/org/sonar/server/filters/FilterExecutorTest/views.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<dataset>
- <!-- java project -->
- <projects long_name="java project" id="1" scope="PRJ" kee="project:java" qualifier="TRK" name="java project"
- root_id="[null]"
- description="[null]" enabled="true" language="java" copy_resource_id="[null]" person_id="[null]"/>
-
- <!-- views -->
- <projects long_name="Root view" id="2" scope="PRJ" kee="ROOT_VIEW" qualifier="VW" name="Root view"
- root_id="[null]"
- description="[null]" enabled="true" language="[null]" copy_resource_id="[null]" person_id="[null]"/>
-
- <projects long_name="Sub view" id="3" scope="PRJ" kee="SUB_VIEW" qualifier="SVW" name="Sub view"
- root_id="2"
- description="[null]" enabled="true" language="[null]" copy_resource_id="[null]" person_id="[null]"/>
-
- <!-- java project copy used in view -->
- <projects long_name="java project" id="4" scope="FIL" kee="cp-project:java" qualifier="TRK" name="java project"
- root_id="2"
- description="[null]" enabled="true" language="java" copy_resource_id="1"/>
-
-
- <!-- snapshots -->
- <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- id="1"
- uuid="u1"
- created_at="1230163200000" build_date="1230163200000" version="1.0" project_id="1" scope="PRJ" qualifier="TRK"
- root_project_id="1" STATUS="P" ISLAST="true"
- path=""
- depth="0"/>
-
- <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- id="2"
- uuid="u2"
- created_at="1230163201000" build_date="1230163201000" version="1.0" project_id="3" scope="PRJ" qualifier="VW"
- root_project_id="2" STATUS="P" ISLAST="true"
- path=""
- depth="0"/>
-
- <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- id="3"
- uuid="u3"
- created_at="1230163201000" build_date="1230163201000" version="1.0" project_id="3" scope="PRJ" qualifier="SVW"
- root_project_id="2" root_snapshot_id="2" STATUS="P" ISLAST="true"
- path="2."
- depth="1"/>
-
- <snapshots purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- id="4"
- uuid="u4"
- created_at="1230163200000" build_date="1230163200000" version="1.0" project_id="4" scope="FIL" qualifier="TRK"
- root_project_id="2" root_snapshot_id="2" STATUS="P" ISLAST="true"
- path="2.3."
- depth="2"/>
-
-
-</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml
index 8e87303e302..ac89dc2cc4a 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml
@@ -61,7 +61,6 @@
<project_measures id="1001"
metric_id="1"
value="500"
- snapshot_id="101"
analysis_uuid="u101"
person_id="[null]"
variation_value_1="[null]"
@@ -79,7 +78,6 @@
<project_measures id="1002"
metric_id="1"
value="300"
- snapshot_id="101"
analysis_uuid="u101"
person_id="30000"
variation_value_1="[null]"
@@ -96,7 +94,6 @@
<project_measures id="1003"
metric_id="1"
value="200"
- snapshot_id="101"
analysis_uuid="u101"
person_id="40000"
variation_value_1="[null]"
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml
index 02382f0b85d..4242edcfbc8 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml
@@ -59,7 +59,6 @@
<project_measures id="1001"
metric_id="1"
value="500"
- snapshot_id="101"
analysis_uuid="u101"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -74,7 +73,7 @@
person_id="[null]"/>
<!-- details of the measure by model characteristic -->
- <!--project_measures id="1002" metric_id="1" value="300" snapshot_id="101" characteristic_id="30000"
+ <!--project_measures id="1002" metric_id="1" value="300" characteristic_id="30000"
url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]"
variation_value_4="[null]" variation_value_5="400"
rule_priority="[null]" alert_text="[null]" RULES_CATEGORY_ID="[null]"
@@ -82,7 +81,7 @@
component_uuid="ABCD"
alert_status="[null]" description="[null]" person_id="[null]"/>-->
- <!--project_measures id="1003" metric_id="1" value="200" snapshot_id="101" characteristic_id="40000"
+ <!--project_measures id="1003" metric_id="1" value="200" characteristic_id="40000"
url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]"
variation_value_4="[null]" variation_value_5="400"
alert_text="[null]" RULES_CATEGORY_ID="[null]"
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml
index 336457595b8..8a870e0ab2c 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml
@@ -161,7 +161,6 @@
<project_measures id="1001"
metric_id="1"
value="510"
- snapshot_id="101"
analysis_uuid="u101"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -177,7 +176,6 @@
<project_measures id="1002"
metric_id="1"
value="510"
- snapshot_id="102"
analysis_uuid="u101"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -193,7 +191,6 @@
<project_measures id="1003"
metric_id="1"
value="500"
- snapshot_id="103"
analysis_uuid="u101"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -209,7 +206,6 @@
<project_measures id="1004"
metric_id="1"
value="10"
- snapshot_id="104"
analysis_uuid="u101"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -226,7 +222,6 @@
<project_measures id="1005"
metric_id="2"
value="[null]"
- snapshot_id="101"
analysis_uuid="u101"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -243,7 +238,6 @@
<project_measures id="1006"
metric_id="3"
value="12.3"
- snapshot_id="101"
analysis_uuid="u101"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -304,7 +298,6 @@
<project_measures id="1010"
metric_id="1"
value="5000"
- snapshot_id="110"
analysis_uuid="u110"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -320,7 +313,6 @@
<project_measures id="1011"
metric_id="2"
value="[null]"
- snapshot_id="110"
analysis_uuid="u110"
variation_value_1="[null]"
variation_value_2="[null]"
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml
index 03535c65ecd..d6a9982ad05 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml
@@ -63,7 +63,6 @@
<project_measures id="1001"
metric_id="5"
value="510"
- snapshot_id="101"
analysis_uuid="u101"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -124,7 +123,6 @@
<project_measures id="1010"
metric_id="5"
value="5000"
- snapshot_id="110"
analysis_uuid="u110"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -185,7 +183,6 @@
<project_measures id="1020"
metric_id="5"
value="5000"
- snapshot_id="120"
analysis_uuid="u120"
variation_value_1="[null]"
variation_value_2="[null]"
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1270_drop_tree_columns_from_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1270_drop_indices_on_tree_columns_of_snapshots.rb
index 5c01eddf447..56067d8419f 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1270_drop_tree_columns_from_snapshots.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1270_drop_indices_on_tree_columns_of_snapshots.rb
@@ -21,14 +21,13 @@
#
# SonarQube 6.0
#
-class DropTreeColumnsFromSnapshots < ActiveRecord::Migration
+class DropIndicesOnTreeColumnsOfSnapshots < ActiveRecord::Migration
def self.up
remove_index_quietly 'snapshots_qualifier'
remove_index_quietly 'snapshots_root'
remove_index_quietly 'snapshots_parent'
remove_index_quietly 'snapshot_root_component'
- execute_java_migration('org.sonar.db.version.v60.DropTreeColumnsFromSnapshots')
end
private
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1271_drop_tree_columns_from_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1271_drop_tree_columns_from_snapshots.rb
new file mode 100644
index 00000000000..262b376f175
--- /dev/null
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1271_drop_tree_columns_from_snapshots.rb
@@ -0,0 +1,30 @@
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2014 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# SonarQube is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# SonarQube is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
+#
+# SonarQube 6.0
+#
+class DropTreeColumnsFromSnapshots < ActiveRecord::Migration
+
+ def self.up
+ execute_java_migration('org.sonar.db.version.v60.DropTreeColumnsFromSnapshots')
+ end
+
+end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1272_drop_index_on_snapshot_id_of_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1272_drop_index_on_snapshot_id_of_measures.rb
new file mode 100644
index 00000000000..d37b1000d97
--- /dev/null
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1272_drop_index_on_snapshot_id_of_measures.rb
@@ -0,0 +1,34 @@
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2014 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# SonarQube is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# SonarQube is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
+#
+# SonarQube 6.0
+#
+class DropIndexOnSnapshotIdOfMeasures < ActiveRecord::Migration
+
+ def self.up
+ begin
+ remove_index :project_measures, :name => 'measures_sid_metric'
+ rescue
+ #ignore
+ end
+ end
+
+end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1273_drop_snapshot_id_column_from_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1273_drop_snapshot_id_column_from_measures.rb
new file mode 100644
index 00000000000..8822b7c916e
--- /dev/null
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1273_drop_snapshot_id_column_from_measures.rb
@@ -0,0 +1,30 @@
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2014 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# SonarQube is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# SonarQube is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
+#
+# SonarQube 6.0
+#
+class DropSnapshotIdColumnFromMeasures < ActiveRecord::Migration
+
+ def self.up
+ execute_java_migration('org.sonar.db.version.v60.DropSnapshotIdColumnFromMeasures')
+ end
+
+end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1274_add_index_on_analysis_uuid_of_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1274_add_index_on_analysis_uuid_of_measures.rb
new file mode 100644
index 00000000000..f2ad93b0193
--- /dev/null
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1274_add_index_on_analysis_uuid_of_measures.rb
@@ -0,0 +1,29 @@
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2014 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# SonarQube is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# SonarQube is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
+#
+# SonarQube 6.0
+#
+class AddIndexOnAnalysisUuidOfMeasures < ActiveRecord::Migration
+
+ def self.up
+ add_index :project_measures, [:analysis_uuid, :metric_id], :name => 'measures_analysis_metric'
+ end
+end