aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db/src
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 /sonar-db/src
parente816a69c28603e73673e50295bc0d3a88f01081d (diff)
downloadsonarqube-03ef0355ef27e7dc0a69de9f69fa6103abe01f0e.tar.gz
sonarqube-03ef0355ef27e7dc0a69de9f69fa6103abe01f0e.zip
SONAR-7780 Drop column PROJECT_MEASURES.SNAPSHOT_ID
Diffstat (limited to 'sonar-db/src')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java2
-rw-r--r--sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java4
-rw-r--r--sonar-db/src/main/java/org/sonar/db/version/v60/DropSnapshotIdColumnFromMeasures.java40
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql4
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl3
-rw-r--r--sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/version/v60/DropSnapshotIdColumnFromMeasuresTest.java47
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/get_last_snapshot_by_component_uuid.xml246
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml1
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml1
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml2
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingAnalysis-result.xml1
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingAnalysis.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis-result.xml2
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis.xml2
20 files changed, 97 insertions, 284 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
index b4502015897..6e2c2b45bf7 100644
--- a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
+++ b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
@@ -30,7 +30,7 @@ import org.sonar.db.MyBatis;
public class DatabaseVersion {
- public static final int LAST_VERSION = 1_270;
+ public static final int LAST_VERSION = 1_274;
/**
* The minimum supported version which can be upgraded. Lower
diff --git a/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java b/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java
index a074b019c92..70c455862a7 100644
--- a/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java
+++ b/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java
@@ -113,6 +113,7 @@ import org.sonar.db.version.v60.DropProjectIdColumnFromMeasures;
import org.sonar.db.version.v60.DropRememberMeColumnsFromUsers;
import org.sonar.db.version.v60.DropSnapshotIdColumnFromCeActivity;
import org.sonar.db.version.v60.DropSnapshotIdColumnFromEvents;
+import org.sonar.db.version.v60.DropSnapshotIdColumnFromMeasures;
import org.sonar.db.version.v60.DropSnapshotIdColumnsFromDuplicationsIndex;
import org.sonar.db.version.v60.DropTreeColumnsFromSnapshots;
import org.sonar.db.version.v60.DropTreesOfSnapshots;
@@ -305,7 +306,8 @@ public class MigrationStepModule extends Module {
MakeAnalysisUuidNotNullOnMeasures.class,
DropTreesOfSnapshots.class,
- DropTreeColumnsFromSnapshots.class
+ DropTreeColumnsFromSnapshots.class,
+ DropSnapshotIdColumnFromMeasures.class
);
}
}
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/DropSnapshotIdColumnFromMeasures.java b/sonar-db/src/main/java/org/sonar/db/version/v60/DropSnapshotIdColumnFromMeasures.java
new file mode 100644
index 00000000000..b992bc747cd
--- /dev/null
+++ b/sonar-db/src/main/java/org/sonar/db/version/v60/DropSnapshotIdColumnFromMeasures.java
@@ -0,0 +1,40 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program 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.
+ *
+ * This program 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.
+ */
+package org.sonar.db.version.v60;
+
+import java.sql.SQLException;
+import org.sonar.db.Database;
+import org.sonar.db.version.DdlChange;
+import org.sonar.db.version.DropColumnsBuilder;
+
+public class DropSnapshotIdColumnFromMeasures extends DdlChange {
+
+ private static final String TABLE = "project_measures";
+
+ public DropSnapshotIdColumnFromMeasures(Database db) {
+ super(db);
+ }
+
+ @Override
+ public void execute(Context context) throws SQLException {
+ context.execute(new DropColumnsBuilder(getDatabase().getDialect(), TABLE, "snapshot_id").build());
+ }
+
+}
diff --git a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
index 0152eefd204..d753b8a5017 100644
--- a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
+++ b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
@@ -477,6 +477,10 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1267');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1268');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1269');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1270');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1271');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1272');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1273');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1274');
INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, EXTERNAL_IDENTITY, EXTERNAL_IDENTITY_PROVIDER, USER_LOCAL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT) VALUES (1, 'admin', 'Administrator', '', 'admin', 'sonarqube', true, 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482');
ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
diff --git a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
index b4ff7ab06de..1983c30d7a3 100644
--- a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
+++ b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
@@ -194,7 +194,6 @@ CREATE TABLE "PROJECT_MEASURES" (
"METRIC_ID" INTEGER NOT NULL,
"COMPONENT_UUID" VARCHAR(50) NOT NULL,
"ANALYSIS_UUID" VARCHAR(50) NOT NULL,
- "SNAPSHOT_ID" INTEGER,
"TEXT_VALUE" VARCHAR(4000),
"ALERT_STATUS" VARCHAR(5),
"ALERT_TEXT" VARCHAR(4000),
@@ -554,7 +553,7 @@ CREATE INDEX "INDEX_GROUPS_USERS_ON_USER_ID" ON "GROUPS_USERS" ("USER_ID");
CREATE UNIQUE INDEX "GROUPS_USERS_UNIQUE" ON "GROUPS_USERS" ("GROUP_ID", "USER_ID");
-CREATE INDEX "MEASURES_SID_METRIC" ON "PROJECT_MEASURES" ("SNAPSHOT_ID", "METRIC_ID");
+CREATE INDEX "MEASURES_ANALYSIS_METRIC" ON "PROJECT_MEASURES" ("ANALYSIS_UUID", "METRIC_ID");
CREATE INDEX "MEASURES_PERSON" ON "PROJECT_MEASURES" ("PERSON_ID");
diff --git a/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java b/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java
index 579506d38b1..c5fbc32539b 100644
--- a/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java
@@ -29,6 +29,6 @@ public class MigrationStepModuleTest {
public void verify_count_of_added_MigrationStep_types() {
ComponentContainer container = new ComponentContainer();
new MigrationStepModule().configure(container);
- assertThat(container.size()).isEqualTo(126);
+ assertThat(container.size()).isEqualTo(127);
}
}
diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/DropSnapshotIdColumnFromMeasuresTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/DropSnapshotIdColumnFromMeasuresTest.java
new file mode 100644
index 00000000000..80f21f17ebc
--- /dev/null
+++ b/sonar-db/src/test/java/org/sonar/db/version/v60/DropSnapshotIdColumnFromMeasuresTest.java
@@ -0,0 +1,47 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program 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.
+ *
+ * This program 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.
+ */
+package org.sonar.db.version.v60;
+
+import java.sql.SQLException;
+import org.junit.Test;
+import org.sonar.db.Database;
+import org.sonar.db.dialect.PostgreSql;
+import org.sonar.db.version.DdlChange;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class DropSnapshotIdColumnFromMeasuresTest {
+
+ private Database database = mock(Database.class);
+ private DropSnapshotIdColumnFromMeasures underTest = new DropSnapshotIdColumnFromMeasures(database);
+
+ @Test
+ public void verify_generated_sql_on_postgresql() throws SQLException {
+ when(database.getDialect()).thenReturn(new PostgreSql());
+
+ DdlChange.Context context = mock(DdlChange.Context.class);
+ underTest.execute(context);
+
+ verify(context).execute("ALTER TABLE project_measures DROP COLUMN snapshot_id");
+ }
+
+}
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/get_last_snapshot_by_component_uuid.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/get_last_snapshot_by_component_uuid.xml
deleted file mode 100644
index 60235fa48af..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/get_last_snapshot_by_component_uuid.xml
+++ /dev/null
@@ -1,246 +0,0 @@
-<dataset>
-
- <!-- Struts projects is authorized for all user -->
- <group_roles id="1"
- group_id="[null]"
- resource_id="1"
- role="user"/>
-
-
- <!-- root project -->
- <projects id="1"
- root_id="[null]"
- scope="PRJ"
- qualifier="TRK"
- kee="org.struts:struts"
- name="Struts"
- uuid="ABCD"
- project_uuid="ABCD"
- module_uuid="[null]"
- module_uuid_path="."
- description="the description"
- long_name="Apache Struts"
- enabled="[true]"
- language="java"
- copy_resource_id="[null]"
- person_id="[null]"
- path="[null]"
- authorization_updated_at="[null]"/>
- <snapshots id="1"
- uuid="u1"
- project_id="1"
-
- root_project_id="1"
-
- status="P"
- islast="[true]"
- purge_status="[null]"
- period1_mode="previous_analysis"
- period1_param="[null]"
- period1_date="[null]"
- period2_mode="days"
- period2_param="30"
- period2_date="1316815200000"
- period3_mode="days"
- period3_param="90"
- period3_date="1311631200000"
- period4_mode="previous_analysis"
- period4_param="[null]"
- period4_date="[null]"
- period5_mode="previous_version"
- period5_param="[null]"
- period5_date="[null]"
- depth="[null]"
- scope="PRJ"
- qualifier="TRK"
- created_at="1228222680000"
- build_date="1228222680000"
- version="[null]"
- path=""/>
- <snapshots id="10"
- uuid="u10"
- project_id="1"
-
- root_project_id="1"
-
- status="P"
- islast="[false]"
- 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]"
- depth="[null]"
- scope="PRJ"
- qualifier="TRK"
- created_at="1228136280000"
- build_date="1228136280000"
- version="[null]"
- path=""/>
-
- <!-- module -->
- <projects id="2"
- root_id="1"
- kee="org.struts:struts-core"
- name="Struts Core"
- uuid="EFGH"
- project_uuid="ABCD"
- module_uuid="[null]"
- module_uuid_path=".ABCD."
- scope="PRJ"
- qualifier="BRC"
- long_name="Struts Core"
- description="[null]"
- enabled="[true]"
- language="java"
- copy_resource_id="[null]"
- person_id="[null]"
- authorization_updated_at="[null]"/>
- <snapshots id="2"
- uuid="u2"
- project_id="2"
-
- root_project_id="1"
- root_snapshot_id="1"
- status="P"
- islast="[true]"
- 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]"
- depth="[null]"
- scope="PRJ"
- qualifier="BRC"
- created_at="1228222680000"
- build_date="1228222680000"
- version="[null]"
- path="1."/>
-
- <!-- directory -->
- <projects long_name="org.struts"
- id="3"
- scope="DIR"
- qualifier="DIR"
- kee="org.struts:struts-core:src/org/struts"
- uuid="GHIJ"
- project_uuid="ABCD"
- module_uuid="EFGH"
- module_uuid_path=".ABCD.EFGH."
- name="src/org/struts"
- root_id="2"
- description="[null]"
- enabled="[true]"
- language="java"
- copy_resource_id="[null]"
- person_id="[null]"
- path="src/org/struts"
- authorization_updated_at="[null]"/>
- <snapshots id="3"
- uuid="u3"
- project_id="3"
-
- root_project_id="1"
- root_snapshot_id="1"
- status="P"
- islast="[true]"
- 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]"
- depth="[null]"
- scope="DIR"
- qualifier="PAC"
- created_at="1228222680000"
- build_date="1228222680000"
- version="[null]"
- path="1.2."/>
-
- <!-- file -->
- <projects long_name="org.struts.RequestContext"
- id="4"
- scope="FIL"
- qualifier="FIL"
- kee="org.struts:struts-core:src/org/struts/RequestContext.java"
- uuid="KLMN"
- project_uuid="ABCD"
- module_uuid="EFGH"
- module_uuid_path=".ABCD.EFGH."
- name="RequestContext.java"
- root_id="2"
- description="[null]"
- enabled="[true]"
- language="java"
- copy_resource_id="[null]"
- person_id="[null]"
- path="src/org/struts/RequestContext.java"
- authorization_updated_at="[null]"/>
-
- <snapshots id="4"
- uuid="u4"
- project_id="4"
-
- root_project_id="1"
- root_snapshot_id="1"
- status="P"
- islast="[true]"
- 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]"
- depth="[null]"
- scope="FIL"
- qualifier="CLA"
- created_at="1228222680000"
- build_date="1228222680000"
- version="[null]"
- path="1.2.3."/>
-
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml
index 2072fa6c6a3..7d63f40cee4 100644
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml
@@ -1,7 +1,6 @@
<dataset>
<project_measures
id="1"
- snapshot_id="2"
analysis_uuid="u2"
metric_id="3"
component_uuid="FILE1"
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml
index bf671f3c2c6..4af31e7637f 100644
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml
@@ -99,7 +99,6 @@
<project_measures id="1"
VALUE="60"
METRIC_ID="1"
- SNAPSHOT_ID="1000"
analysis_uuid="u1000"
person_id="[null]"
component_uuid="ABCD"/>
@@ -107,7 +106,6 @@
<project_measures id="2"
VALUE="80"
METRIC_ID="2"
- SNAPSHOT_ID="1000"
analysis_uuid="u1000"
person_id="[null]"
component_uuid="ABCD"/>
@@ -116,7 +114,6 @@
<project_measures id="3"
VALUE="20"
METRIC_ID="1"
- SNAPSHOT_ID="1001"
analysis_uuid="u1000"
person_id="[null]"
component_uuid="BCDE"/>
@@ -124,7 +121,6 @@
<project_measures id="4"
VALUE="70"
METRIC_ID="2"
- SNAPSHOT_ID="1001"
analysis_uuid="u1000"
person_id="[null]"
component_uuid="BCDE"/>
@@ -133,7 +129,6 @@
<project_measures id="5"
VALUE="5"
METRIC_ID="1"
- SNAPSHOT_ID="1002"
analysis_uuid="u1000"
person_id="[null]"
component_uuid="CDEF"/>
@@ -141,7 +136,6 @@
<project_measures id="6"
VALUE="60"
METRIC_ID="2"
- SNAPSHOT_ID="1002"
analysis_uuid="u1000"
person_id="[null]"
component_uuid="CDEF"/>
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml
index 10e7435e67f..40d6967f54f 100644
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml
@@ -37,7 +37,6 @@
<project_measures id="1"
VALUE="60"
METRIC_ID="1"
- SNAPSHOT_ID="1000"
analysis_uuid="u1000"
person_id="[null]"
component_uuid="ABCD"/>
@@ -45,7 +44,6 @@
<project_measures id="2"
VALUE="20"
METRIC_ID="1"
- SNAPSHOT_ID="1000"
analysis_uuid="u1000"
person_id="20"
component_uuid="ABCD"/>
@@ -53,7 +51,6 @@
<project_measures id="3"
VALUE="40"
METRIC_ID="1"
- SNAPSHOT_ID="1000"
analysis_uuid="u1000"
person_id="21"
component_uuid="ABCD"/>
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml
index bbc405f1e55..cc5fc7a8e78 100644
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml
@@ -20,7 +20,6 @@
islast="[true]"/>
<project_measures id="20"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="10"
value="[null]"
@@ -35,7 +34,6 @@
alert_text="[null]"
component_uuid="FILE1"/>
<project_measures id="21"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="11"
value="[null]"
@@ -50,7 +48,6 @@
alert_text="[null]"
component_uuid="FILE1"/>
<project_measures id="22"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="12"
value="10"
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml
index 0500ab6eaef..728d778319e 100644
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml
@@ -21,7 +21,6 @@
<project_measures id="20"
component_uuid="ABCD"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="10"
value="[null]"
@@ -36,7 +35,6 @@
alert_text="[null]"/>
<project_measures id="21"
component_uuid="ABCD"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="11"
value="[null]"
@@ -51,7 +49,6 @@
alert_text="[null]"/>
<project_measures id="22"
component_uuid="ABCD"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="12"
value="10"
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml
index fe431cc00d0..a82e0419bc9 100644
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml
@@ -27,7 +27,6 @@
/>
<project_measures id="20"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="10"
value="[null]"
@@ -43,7 +42,6 @@
person_id="[null]"
component_uuid="1"/>
<project_measures id="21"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="11"
value="[null]"
@@ -59,7 +57,6 @@
person_id="[null]"
component_uuid="1"/>
<project_measures id="22"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="12"
value="10"
@@ -76,7 +73,6 @@
component_uuid="1"/>
<!--measures for developer 333-->
<project_measures id="30"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="10"
value="[null]"
@@ -92,7 +88,6 @@
person_id="333"
component_uuid="1"/>
<project_measures id="31"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="11"
value="[null]"
@@ -108,7 +103,6 @@
person_id="333"
component_uuid="1"/>
<project_measures id="32"
- snapshot_id="5"
analysis_uuid="u5"
metric_id="12"
value="10"
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml
index 1c9a15c1962..b40e87b9ebd 100644
--- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml
@@ -36,7 +36,6 @@
alert_text="[null]"
VALUE="10.0"
METRIC_ID="1"
- SNAPSHOT_ID="1"
analysis_uuid="u1"
person_id="[null]"
text_value="[null]"
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml
index be0982b5504..1bfbfa5b4c1 100644
--- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml
@@ -36,7 +36,6 @@
alert_text="[null]"
VALUE="10.0"
METRIC_ID="1"
- SNAPSHOT_ID="1"
analysis_uuid="u1"
person_id="[null]"
text_value="[null]"
@@ -98,7 +97,6 @@
alert_text="[null]"
VALUE="10.0"
METRIC_ID="1"
- SNAPSHOT_ID="5"
analysis_uuid="u5"
person_id="[null]"
text_value="[null]"
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingAnalysis-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingAnalysis-result.xml
index 569aa166e67..b2b6d9f4667 100644
--- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingAnalysis-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingAnalysis-result.xml
@@ -55,7 +55,6 @@
<!-- do not delete standard measure -->
<project_measures id="1"
- snapshot_id="1"
analysis_uuid="u1"
metric_id="1"
component_uuid="1"
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingAnalysis.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingAnalysis.xml
index e3ed244edc0..2c0a7c2df25 100644
--- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingAnalysis.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingAnalysis.xml
@@ -57,7 +57,6 @@
<!-- do not delete standard measure -->
<project_measures id="1"
component_uuid="1"
- snapshot_id="1"
analysis_uuid="u1"
metric_id="1"
variation_value_1="[null]"
@@ -76,7 +75,6 @@
<!-- delete measure on metrics that are flagged with delete_historical_data=true -->
<project_measures id="6"
component_uuid="1"
- snapshot_id="1"
analysis_uuid="u1"
metric_id="2"
variation_value_1="[null]"
@@ -95,7 +93,6 @@
<!-- delete measure on developers -->
<project_measures id="7"
component_uuid="1"
- snapshot_id="1"
analysis_uuid="u1"
metric_id="2"
variation_value_1="[null]"
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis-result.xml
index 7ddb144a1de..251f2ea6c7a 100644
--- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis-result.xml
@@ -41,7 +41,6 @@ Note that measures, events and reviews are not deleted.
<project_measures ID="1"
component_uuid="1"
- SNAPSHOT_ID="1"
analysis_uuid="u1"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -101,7 +100,6 @@ Note that measures, events and reviews are not deleted.
<project_measures ID="2"
component_uuid="2"
- SNAPSHOT_ID="2"
analysis_uuid="u2"
variation_value_1="[null]"
variation_value_2="[null]"
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis.xml
index 3a63377810e..fa0e9e864d1 100644
--- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeAnalysis.xml
@@ -28,7 +28,6 @@
<project_measures ID="1"
component_uuid="1"
- SNAPSHOT_ID="1"
analysis_uuid="u1"
variation_value_1="[null]"
variation_value_2="[null]"
@@ -92,7 +91,6 @@
<project_measures ID="2"
component_uuid="2"
- SNAPSHOT_ID="2"
analysis_uuid="u2"
characteristic_id="[null]"
variation_value_1="[null]"