aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/db/migrations/MigrationSteps.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/db/migrations/v52/FeedFileSourcesDataType.java38
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/es/EsUtils.java7
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest.java54
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/source/db/FileSourceDaoTest.java10
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/component/db/ComponentDaoTest/select_module_files_tree.xml4
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/computation/issue/SourceLinesCacheTest/load_data.xml2
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/computation/step/IndexSourceLinesStepTest/index_source.xml4
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/migrate-result.xml10
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/migrate.xml7
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/schema.sql8
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/insert-result.xml4
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/shared.xml2
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update-result.xml2
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero-result.xml6
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero.xml6
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/filter_by_project.xml4
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/filter_by_project_and_date.xml4
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/schema.sql1
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/shared.xml2
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceLineIndexerTest/db.xml2
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/shared.xml2
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/912_add_file_sources_data_type.rb40
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/913_feed_file_sources_data_type.rb31
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/file_sources_missing_src_hash.xml2
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/shared.xml2
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/testPersistDontTouchUnchanged-result.xml2
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/testPersistEmptyFile-result.xml4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/source/db/FileSourceDto.java15
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl3
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/source/db/FileSourceMapper.xml11
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml4
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/select_purgeable_file_uuids.xml4
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml2
37 files changed, 264 insertions, 45 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/MigrationSteps.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/MigrationSteps.java
index 2da008de6de..c333435dbf5 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/MigrationSteps.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/MigrationSteps.java
@@ -68,6 +68,7 @@ import org.sonar.server.db.migrations.v52.AddDependenciesComponentUuidColumns;
import org.sonar.server.db.migrations.v52.DropDependenciesComponentColumns;
import org.sonar.server.db.migrations.v52.FeedDependenciesComponentUuids;
import org.sonar.server.db.migrations.v52.FeedEventsComponentUuid;
+import org.sonar.server.db.migrations.v52.FeedFileSourcesDataType;
import org.sonar.server.db.migrations.v52.FeedProjectLinksComponentUuid;
import org.sonar.server.db.migrations.v52.MoveProjectProfileAssociation;
@@ -141,6 +142,7 @@ public interface MigrationSteps {
MoveProjectProfileAssociation.class,
AddDependenciesComponentUuidColumns.class,
FeedDependenciesComponentUuids.class,
- DropDependenciesComponentColumns.class
+ DropDependenciesComponentColumns.class,
+ FeedFileSourcesDataType.class
);
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v52/FeedFileSourcesDataType.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v52/FeedFileSourcesDataType.java
new file mode 100644
index 00000000000..44ca514dd93
--- /dev/null
+++ b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v52/FeedFileSourcesDataType.java
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+package org.sonar.server.db.migrations.v52;
+
+import org.sonar.core.persistence.Database;
+import org.sonar.server.db.migrations.BaseDataChange;
+
+import java.sql.SQLException;
+
+public class FeedFileSourcesDataType extends BaseDataChange {
+
+ public FeedFileSourcesDataType(Database db) {
+ super(db);
+ }
+
+ @Override
+ public void execute(Context context) throws SQLException {
+ context.prepareUpsert("update file_sources set data_type = 'SOURCE'").execute().commit();
+ }
+}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/EsUtils.java b/server/sonar-server/src/main/java/org/sonar/server/es/EsUtils.java
index 05b17e4a73e..ac066ab5f7b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/es/EsUtils.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/es/EsUtils.java
@@ -29,7 +29,12 @@ import org.sonar.server.search.BaseDoc;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
-import java.util.*;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
public class EsUtils {
diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest.java
new file mode 100644
index 00000000000..f770363e269
--- /dev/null
+++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+package org.sonar.server.db.migrations.v52;
+
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.sonar.core.persistence.DbTester;
+import org.sonar.server.db.migrations.MigrationStep;
+
+public class FeedFileSourcesDataTypeTest {
+
+ @ClassRule
+ public static DbTester db = new DbTester().schema(FeedFileSourcesDataTypeTest.class, "schema.sql");
+
+ MigrationStep migration;
+
+ @Before
+ public void setUp() throws Exception {
+ db.executeUpdateSql("truncate table file_sources");
+
+ migration = new FeedFileSourcesDataType(db.database());
+ }
+
+ @Test
+ public void migrate_empty_db() throws Exception {
+ migration.execute();
+ }
+
+ @Test
+ public void migrate() throws Exception {
+ db.prepareDbUnit(this.getClass(), "migrate.xml");
+ migration.execute();
+ db.assertDbUnit(this.getClass(), "migrate-result.xml", "file_sources");
+ }
+}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/db/FileSourceDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/db/FileSourceDaoTest.java
index 56fbcaa91b5..dbf2968ebdd 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/source/db/FileSourceDaoTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/source/db/FileSourceDaoTest.java
@@ -64,6 +64,7 @@ public class FileSourceDaoTest extends AbstractDaoTestCase {
assertThat(fileSourceDto.getFileUuid()).isEqualTo("FILE1_UUID");
assertThat(fileSourceDto.getCreatedAt()).isEqualTo(1500000000000L);
assertThat(fileSourceDto.getUpdatedAt()).isEqualTo(1500000000000L);
+ assertThat(fileSourceDto.getDataType()).isEqualTo(FileSourceDto.Type.SOURCE);
}
@Test
@@ -107,26 +108,29 @@ public class FileSourceDaoTest extends AbstractDaoTestCase {
.setDataHash("FILE2_DATA_HASH")
.setLineHashes("LINE1_HASH\\nLINE2_HASH")
.setSrcHash("FILE2_HASH")
+ .setDataType(FileSourceDto.Type.SOURCE)
.setCreatedAt(1500000000000L)
.setUpdatedAt(1500000000001L));
- checkTable("insert", "file_sources", "project_uuid", "file_uuid", "data_hash", "line_hashes", "src_hash", "created_at", "updated_at");
+ checkTable("insert", "file_sources", "project_uuid", "file_uuid", "data_hash", "line_hashes", "src_hash", "created_at", "updated_at", "data_type");
}
@Test
public void update() throws Exception {
setupData("shared");
- dao.update(new FileSourceDto().setId(101L)
+ dao.update(new FileSourceDto()
+ .setId(101L)
.setProjectUuid("PRJ_UUID")
.setFileUuid("FILE1_UUID")
.setBinaryData("updated data".getBytes())
.setDataHash("NEW_DATA_HASH")
.setSrcHash("NEW_FILE_HASH")
.setLineHashes("NEW_LINE_HASHES")
+ .setDataType(FileSourceDto.Type.SOURCE)
.setUpdatedAt(1500000000002L));
- checkTable("update", "file_sources", "project_uuid", "file_uuid", "data_hash", "line_hashes", "src_hash", "created_at", "updated_at");
+ checkTable("update", "file_sources", "project_uuid", "file_uuid", "data_hash", "line_hashes", "src_hash", "created_at", "updated_at", "data_type");
}
@Test
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/component/db/ComponentDaoTest/select_module_files_tree.xml b/server/sonar-server/src/test/resources/org/sonar/server/component/db/ComponentDaoTest/select_module_files_tree.xml
index 20e8797e9d4..1370ae1ee61 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/component/db/ComponentDaoTest/select_module_files_tree.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/component/db/ComponentDaoTest/select_module_files_tree.xml
@@ -24,7 +24,7 @@
line_hashes="lineEFGHI"
data_hash="dataEFGHI"
src_hash="srcEFGHI"
- created_at="1412952242000" updated_at="1412952242000"/>
+ created_at="1412952242000" updated_at="1412952242000" data_type="SOURCE" />
<!-- sub module -->
<projects id="4" root_id="1" kee="org.struts:struts-data" name="Struts Data"
@@ -51,6 +51,6 @@
line_hashes="lineHIJK"
data_hash="dataHIJK"
src_hash="srcHIJK"
- created_at="1412952242000" updated_at="1412952242000"/>
+ created_at="1412952242000" updated_at="1412952242000" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/issue/SourceLinesCacheTest/load_data.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/issue/SourceLinesCacheTest/load_data.xml
index 24e4d0c14d0..25d680c3e46 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/computation/issue/SourceLinesCacheTest/load_data.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/issue/SourceLinesCacheTest/load_data.xml
@@ -9,5 +9,5 @@
line_hashes="8d7b3d6b83c0a517eac07e1aac94b773&#10;9a0364b9e99bb480dd25e1f0284c8555"
data_hash="0263047cd758c68c27683625f072f010"
src_hash="123456"
- created_at="1412952242000" updated_at="1412952242000"/>
+ created_at="1412952242000" updated_at="1412952242000" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/IndexSourceLinesStepTest/index_source.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/IndexSourceLinesStepTest/index_source.xml
index 62401136eb3..c1785bed889 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/IndexSourceLinesStepTest/index_source.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/IndexSourceLinesStepTest/index_source.xml
@@ -2,10 +2,10 @@
<file_sources id="101" project_uuid="ABCD" file_uuid="FILE1_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
- created_at="1500000000000" updated_at="0"/>
+ created_at="1500000000000" updated_at="0" data_type="SOURCE" />
<file_sources id="102" project_uuid="DCBA" file_uuid="FILE2_UUID"
binary_data="edcba" data_hash="hash2" line_hashes="CBA\nFDE\nIHG" src_hash="FILE2_HASH"
- created_at="1500000000000" updated_at="0"/>
+ created_at="1500000000000" updated_at="0" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/migrate-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/migrate-result.xml
new file mode 100644
index 00000000000..3788fbf38ef
--- /dev/null
+++ b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/migrate-result.xml
@@ -0,0 +1,10 @@
+<dataset>
+
+ <file_sources id="1" project_uuid="project-1" file_uuid="file-1" data_type="SOURCE" created_at="123456789"
+ updated_at="456456456"/>
+ <file_sources id="2" project_uuid="project-2" file_uuid="file-2" data_type="SOURCE" created_at="123456789"
+ updated_at="456456456"/>
+ <file_sources id="3" project_uuid="project-3" file_uuid="file-3" data_type="SOURCE" created_at="123456789"
+ updated_at="456456456"/>
+
+</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/migrate.xml b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/migrate.xml
new file mode 100644
index 00000000000..402bb36e61d
--- /dev/null
+++ b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/migrate.xml
@@ -0,0 +1,7 @@
+<dataset>
+
+ <file_sources id="1" project_uuid="project-1" file_uuid="file-1" data_type="[null]" created_at="123456789" updated_at="456456456" />
+ <file_sources id="2" project_uuid="project-2" file_uuid="file-2" data_type="SOURCE" created_at="123456789" updated_at="456456456" />
+ <file_sources id="3" project_uuid="project-3" file_uuid="file-3" data_type="[null]" created_at="123456789" updated_at="456456456" />
+
+</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/schema.sql b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/schema.sql
new file mode 100644
index 00000000000..84eb7749817
--- /dev/null
+++ b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest/schema.sql
@@ -0,0 +1,8 @@
+CREATE TABLE "FILE_SOURCES" (
+ "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+ "PROJECT_UUID" VARCHAR(50) NOT NULL,
+ "FILE_UUID" VARCHAR(50) NOT NULL,
+ "DATA_TYPE" VARCHAR(20),
+ "CREATED_AT" BIGINT NOT NULL,
+ "UPDATED_AT" BIGINT NOT NULL
+);
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/insert-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/insert-result.xml
index 74bca5ec788..4f347782dca 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/insert-result.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/insert-result.xml
@@ -4,7 +4,7 @@
binary_data="abcde" data_hash="hash"
line_hashes="ABC\nDEF\nGHI"
src_hash="FILE_HASH"
- created_at="1500000000000" updated_at="1500000000000" />
+ created_at="1500000000000" updated_at="1500000000000" data_type="SOURCE" />
<file_sources id="102" project_uuid="PRJ_UUID" file_uuid="FILE2_UUID"
@@ -12,6 +12,6 @@
data_hash="FILE2_DATA_HASH"
line_hashes="LINE1_HASH\nLINE2_HASH"
src_hash="FILE2_HASH"
- created_at="1500000000000" updated_at="1500000000001" />
+ created_at="1500000000000" updated_at="1500000000001" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/shared.xml
index 79a340f841d..5187ca217af 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/shared.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/shared.xml
@@ -4,6 +4,6 @@
binary_data="abcde" data_hash="hash"
line_hashes="ABC\nDEF\nGHI"
src_hash="FILE_HASH"
- created_at="1500000000000" updated_at="1500000000000" />
+ created_at="1500000000000" updated_at="1500000000000" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update-result.xml
index 40cbfa91a43..8dbe32d946d 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update-result.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update-result.xml
@@ -5,7 +5,7 @@
data_hash="NEW_DATA_HASH"
line_hashes="NEW_LINE_HASHES"
src_hash="NEW_FILE_HASH"
- created_at="1500000000000" updated_at="1500000000002" />
+ created_at="1500000000000" updated_at="1500000000002" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero-result.xml
index 931bab04e18..1ba1fe63a55 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero-result.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero-result.xml
@@ -3,16 +3,16 @@
<!-- Updated -->
<file_sources id="101" project_uuid="ABCD" file_uuid="FILE1_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
- created_at="1500000000000" updated_at="1500000000002"/>
+ created_at="1500000000000" updated_at="1500000000002" data_type="SOURCE" />
<!-- Not updated because updated_at is not null -->
<file_sources id="102" project_uuid="ABCD" file_uuid="FILE2_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
- created_at="1500000000000" updated_at="1500000000000"/>
+ created_at="1500000000000" updated_at="1500000000000" data_type="SOURCE" />
<!-- Not updated because on another project -->
<file_sources id="103" project_uuid="BCDE" file_uuid="FILE3_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
- created_at="1500000000000" updated_at="0"/>
+ created_at="1500000000000" updated_at="0" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero.xml
index 9782d5c3837..77a1f85b06a 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/source/db/FileSourceDaoTest/update_date_when_updated_date_is_zero.xml
@@ -3,14 +3,14 @@
<!-- Only this source should be updated -->
<file_sources id="101" project_uuid="ABCD" file_uuid="FILE1_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
- created_at="1500000000000" updated_at="0"/>
+ created_at="1500000000000" updated_at="0" data_type="SOURCE" />
<file_sources id="102" project_uuid="ABCD" file_uuid="FILE2_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
- created_at="1500000000000" updated_at="1500000000000"/>
+ created_at="1500000000000" updated_at="1500000000000" data_type="SOURCE" />
<file_sources id="103" project_uuid="BCDE" file_uuid="FILE3_UUID"
binary_data="abcde" data_hash="hash" line_hashes="ABC\nDEF\nGHI" src_hash="FILE_HASH"
- created_at="1500000000000" updated_at="0"/>
+ created_at="1500000000000" updated_at="0" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/filter_by_project.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/filter_by_project.xml
index aeeffbdc05a..1f0032170a0 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/filter_by_project.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/filter_by_project.xml
@@ -1,9 +1,9 @@
<dataset>
<file_sources id="1" project_uuid="P1" file_uuid="F1" created_at="1416238020000" updated_at="1416239042000"
- binary_data="" data_hash="" />
+ binary_data="" data_hash="" data_type="SOURCE" />
<file_sources id="2" project_uuid="P2" file_uuid="F2" created_at="1416238020000" updated_at="1416239042000"
- binary_data="" data_hash="" />
+ binary_data="" data_hash="" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/filter_by_project_and_date.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/filter_by_project_and_date.xml
index db7a9977db3..e6289cd994c 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/filter_by_project_and_date.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/filter_by_project_and_date.xml
@@ -1,9 +1,9 @@
<dataset>
<file_sources id="1" project_uuid="P1" file_uuid="F1" created_at="1416238020000" updated_at="1416239042000"
- binary_data="" data_hash="" />
+ binary_data="" data_hash="" data_type="SOURCE" />
<file_sources id="2" project_uuid="P1" file_uuid="F2" created_at="1416238020000" updated_at="1300000000000"
- binary_data="" data_hash="" />
+ binary_data="" data_hash="" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/schema.sql b/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/schema.sql
index 859eefe3625..99f823ff74d 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/schema.sql
+++ b/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/schema.sql
@@ -5,6 +5,7 @@ CREATE TABLE "FILE_SOURCES" (
"FILE_UUID" VARCHAR(50) NOT NULL,
"BINARY_DATA" BINARY(167772150),
"DATA_HASH" VARCHAR(50) NOT NULL,
+ "DATA_TYPE" VARCHAR(50),
"CREATED_AT" BIGINT NOT NULL,
"UPDATED_AT" BIGINT NOT NULL
);
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/shared.xml
index f56c7f5a796..053270327d6 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/shared.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceFileResultSetIteratorTest/shared.xml
@@ -1,6 +1,6 @@
<dataset>
<file_sources id="1" project_uuid="P1" file_uuid="F1" created_at="1416238020000" updated_at="1416239042000"
- binary_data="" data_hash="" />
+ binary_data="" data_hash="" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceLineIndexerTest/db.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceLineIndexerTest/db.xml
index 48e58478ab6..bea210dc670 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceLineIndexerTest/db.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/source/index/SourceLineIndexerTest/db.xml
@@ -1,6 +1,6 @@
<dataset>
<file_sources id="1" project_uuid="PROJECT_UUID" file_uuid="FILE_UUID" created_at="1416238020000" updated_at="1416239042000"
- binary_data="" data_hash="DATA_HASH" />
+ binary_data="" data_hash="DATA_HASH" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/shared.xml
index 4dcc5c21ee0..2c1b4111c26 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/shared.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/shared.xml
@@ -8,6 +8,6 @@
binary_data="" data_hash="hash"
line_hashes="987654"
src_hash="12345"
- created_at="1414597442000" updated_at="1414683842000"/>
+ created_at="1414597442000" updated_at="1414683842000" data_type="SOURCE" />
</dataset>
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/912_add_file_sources_data_type.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/912_add_file_sources_data_type.rb
new file mode 100644
index 00000000000..21da15f2111
--- /dev/null
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/912_add_file_sources_data_type.rb
@@ -0,0 +1,40 @@
+#
+# 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 5.2
+# SONAR-6255
+#
+class AddFileSourcesDataType < ActiveRecord::Migration
+
+ def self.up
+ add_column 'file_sources', 'data_type', :string, :limit => 20
+ remove_index_quietly('file_sources_file_uuid_uniq')
+ add_index 'file_sources', ['file_uuid', 'data_type'], :name => 'file_sources_uuid_type', :unique => true
+ end
+
+ def self.remove_index_quietly(name)
+ begin
+ remove_index('file_sources', :name => name)
+ rescue
+ # probably already removed
+ end
+ end
+end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/913_feed_file_sources_data_type.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/913_feed_file_sources_data_type.rb
new file mode 100644
index 00000000000..08a4e97eea2
--- /dev/null
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/913_feed_file_sources_data_type.rb
@@ -0,0 +1,31 @@
+#
+# 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 5.2
+# SONAR-6255
+#
+class FeedFileSourcesDataType < ActiveRecord::Migration
+
+ def self.up
+ execute_java_migration('org.sonar.server.db.migrations.v52.FeedFileSourcesDataType')
+ end
+
+end
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/file_sources_missing_src_hash.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/file_sources_missing_src_hash.xml
index 4879192217c..9fac445981b 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/file_sources_missing_src_hash.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/file_sources_missing_src_hash.xml
@@ -4,6 +4,6 @@
line_hashes="8d7b3d6b83c0a517eac07e1aac94b773&#10;9a0364b9e99bb480dd25e1f0284c8555"
data_hash="0263047cd758c68c27683625f072f010"
src_hash="[null]"
- created_at="1412952242000" updated_at="1412952242000"/>
+ created_at="1412952242000" updated_at="1412952242000" data_type="SOURCE" />
</dataset>
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/shared.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/shared.xml
index 1223c1869cd..dd27702d8b1 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/shared.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/shared.xml
@@ -4,6 +4,6 @@
line_hashes="8d7b3d6b83c0a517eac07e1aac94b773&#10;9a0364b9e99bb480dd25e1f0284c8555"
data_hash="0263047cd758c68c27683625f072f010"
src_hash="123456"
- created_at="1412952242000" updated_at="1412952242000"/>
+ created_at="1412952242000" updated_at="1412952242000" data_type="SOURCE" />
</dataset>
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/testPersistDontTouchUnchanged-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/testPersistDontTouchUnchanged-result.xml
index b70d53511d0..b5e2373c682 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/testPersistDontTouchUnchanged-result.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/testPersistDontTouchUnchanged-result.xml
@@ -5,6 +5,6 @@
line_hashes="8d7b3d6b83c0a517eac07e1aac94b773&#10;9a0364b9e99bb480dd25e1f0284c8555"
data_hash="0263047cd758c68c27683625f072f010"
src_hash="123456"
- created_at="1412952242000" updated_at="1412952242000"/>
+ created_at="1412952242000" updated_at="1412952242000" data_type="SOURCE" />
</dataset>
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/testPersistEmptyFile-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/testPersistEmptyFile-result.xml
index 9b3a8b549a8..6516bd139ca 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/testPersistEmptyFile-result.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/index/SourcePersisterTest/testPersistEmptyFile-result.xml
@@ -4,12 +4,12 @@
line_hashes="8d7b3d6b83c0a517eac07e1aac94b773&#10;9a0364b9e99bb480dd25e1f0284c8555"
data_hash="0263047cd758c68c27683625f072f010"
src_hash="123456"
- created_at="1412952242000" updated_at="1412952242000"/>
+ created_at="1412952242000" updated_at="1412952242000" data_type="SOURCE" />
<file_sources id="102" project_uuid="projectUuid" file_uuid="uuidempty" binary_data="[null]"
line_hashes="[null]"
src_hash="abcd"
- data_hash="0" created_at="1414597442000" updated_at="1414597442000"/>
+ data_hash="0" created_at="1414597442000" updated_at="1414597442000" data_type="SOURCE" />
</dataset>
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
index 531a662b6bf..2ba0d7afbba 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
@@ -33,7 +33,7 @@ import java.util.List;
*/
public class DatabaseVersion implements BatchComponent, ServerComponent {
- public static final int LAST_VERSION = 911;
+ public static final int LAST_VERSION = 913;
/**
* List of all the tables.n
diff --git a/sonar-core/src/main/java/org/sonar/core/source/db/FileSourceDto.java b/sonar-core/src/main/java/org/sonar/core/source/db/FileSourceDto.java
index 7840d213df6..3efeb1e1db6 100644
--- a/sonar-core/src/main/java/org/sonar/core/source/db/FileSourceDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/source/db/FileSourceDto.java
@@ -42,6 +42,7 @@ public class FileSourceDto {
private String lineHashes;
private String srcHash;
private byte[] binaryData;
+ private String dataType;
private String dataHash;
public Long getId() {
@@ -188,4 +189,18 @@ public class FileSourceDto {
this.updatedAt = updatedAt;
return this;
}
+
+ public String getDataType() {
+ return dataType;
+ }
+
+ public FileSourceDto setDataType(String dataType) {
+ this.dataType = dataType;
+ return this;
+ }
+
+ public static class Type {
+ public final static String SOURCE = "SOURCE";
+ public final static String TEST = "TEST";
+ }
}
diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
index 97fa66aea45..8c2c12a0bef 100644
--- a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
+++ b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
@@ -335,6 +335,8 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('908');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('909');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('910');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('911');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('912');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('913');
INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482', null, null);
ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
index 77e26efde37..5636c21f889 100644
--- a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
+++ b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
@@ -562,6 +562,7 @@ CREATE TABLE "FILE_SOURCES" (
"FILE_UUID" VARCHAR(50) NOT NULL,
"LINE_HASHES" CLOB(2147483647),
"BINARY_DATA" BLOB(167772150),
+ "DATA_TYPE" VARCHAR(20),
"DATA_HASH" VARCHAR(50) NOT NULL,
"SRC_HASH" VARCHAR(50) NULL,
"CREATED_AT" BIGINT NOT NULL,
@@ -714,7 +715,7 @@ CREATE UNIQUE INDEX "PROFILE_UNIQUE_KEY" ON "RULES_PROFILES" ("KEE");
CREATE INDEX "FILE_SOURCES_PROJECT_UUID" ON "FILE_SOURCES" ("PROJECT_UUID");
-CREATE UNIQUE INDEX "FILE_SOURCES_FILE_UUID_UNIQ" ON "FILE_SOURCES" ("FILE_UUID");
+CREATE UNIQUE INDEX "FILE_SOURCES_UUID_TYPE_UNIQUE" ON "FILE_SOURCES" ("FILE_UUID", "DATA_TYPE");
CREATE INDEX "FILE_SOURCES_UPDATED_AT" ON "FILE_SOURCES" ("UPDATED_AT");
diff --git a/sonar-core/src/main/resources/org/sonar/core/source/db/FileSourceMapper.xml b/sonar-core/src/main/resources/org/sonar/core/source/db/FileSourceMapper.xml
index 061c84eb19d..383fe29178a 100644
--- a/sonar-core/src/main/resources/org/sonar/core/source/db/FileSourceMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/source/db/FileSourceMapper.xml
@@ -6,22 +6,22 @@
<select id="select" parameterType="string" resultType="org.sonar.core.source.db.FileSourceDto">
SELECT id, project_uuid as projectUuid, file_uuid as fileUuid, created_at as createdAt, updated_at as updatedAt,
- binary_data as binaryData, line_hashes as lineHashes, data_hash as dataHash, src_hash as srcHash
+ binary_data as binaryData, line_hashes as lineHashes, data_hash as dataHash, src_hash as srcHash, data_type as dataType
FROM file_sources
WHERE file_uuid = #{fileUuid}
</select>
<select id="selectHashesForProject" parameterType="string" resultType="org.sonar.core.source.db.FileSourceDto">
- SELECT id, file_uuid as fileUuid, data_hash as dataHash, src_hash as srcHash, updated_at as updatedAt
+ SELECT id, file_uuid as fileUuid, data_type as dataType, data_hash as dataHash, src_hash as srcHash, updated_at as updatedAt
FROM file_sources
WHERE project_uuid = #{projectUuid}
</select>
<insert id="insert" parameterType="org.sonar.core.source.db.FileSourceDto" useGeneratedKeys="false">
- INSERT INTO file_sources (project_uuid, file_uuid, created_at, updated_at, binary_data, line_hashes, data_hash, src_hash)
+ INSERT INTO file_sources (project_uuid, file_uuid, created_at, updated_at, binary_data, line_hashes, data_hash, src_hash, data_type)
VALUES (#{projectUuid,jdbcType=VARCHAR}, #{fileUuid,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT},
#{updatedAt,jdbcType=BIGINT}, #{binaryData,jdbcType=BLOB}, #{lineHashes,jdbcType=CLOB},
- #{dataHash,jdbcType=VARCHAR}, #{srcHash,jdbcType=VARCHAR})
+ #{dataHash,jdbcType=VARCHAR}, #{srcHash,jdbcType=VARCHAR},#{dataType,jdbcType=VARCHAR})
</insert>
<update id="update" parameterType="org.sonar.core.source.db.FileSourceDto" useGeneratedKeys="false">
@@ -30,7 +30,8 @@
binary_data = #{binaryData,jdbcType=BLOB},
line_hashes = #{lineHashes,jdbcType=CLOB},
data_hash = #{dataHash,jdbcType=VARCHAR},
- src_hash = #{srcHash,jdbcType=VARCHAR}
+ src_hash = #{srcHash,jdbcType=VARCHAR},
+ data_type = #{dataType,jdbcType=VARCHAR}
WHERE id = #{id}
</update>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml
index 7caaa526513..584b0109197 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml
@@ -1,5 +1,5 @@
<dataset>
<file_sources id="2" project_uuid="ABCD" file_uuid="KLMN" binary_data="[null]" line_hashes="[null]" data_hash="321654988"
- created_at="123456789" updated_at="123456789" src_hash="123456"/>
+ created_at="123456789" updated_at="123456789" src_hash="123456" data_type="SOURCE" />
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml
index aaae9915d98..f9a5fcbb2ae 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml
@@ -73,7 +73,7 @@
build_date="1228222680000" version="[null]" path="[null]"/>
<file_sources id="1" project_uuid="ABCD" file_uuid="GHIJ" binary_data="[null]" line_hashes="[null]" data_hash="321654987"
- created_at="123456789" updated_at="123456789" src_hash="12345"/>
+ created_at="123456789" updated_at="123456789" src_hash="12345" data_type="SOURCE" />
<file_sources id="2" project_uuid="ABCD" file_uuid="KLMN" binary_data="[null]" line_hashes="[null]" data_hash="321654988"
- created_at="123456789" updated_at="123456789" src_hash="123456"/>
+ created_at="123456789" updated_at="123456789" src_hash="123456" data_type="SOURCE" />
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/select_purgeable_file_uuids.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/select_purgeable_file_uuids.xml
index 5bbb5aa5891..f6573e509dd 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/select_purgeable_file_uuids.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/select_purgeable_file_uuids.xml
@@ -80,7 +80,7 @@
build_date="1228222680000" version="[null]" path="[null]"/>
<file_sources id="1" project_uuid="ABCD" file_uuid="GHIJ" binary_data="[null]" line_hashes="[null]" data_hash="321654987"
- created_at="123456789" updated_at="123456789"/>
+ created_at="123456789" updated_at="123456789" data_type="SOURCE" />
<file_sources id="2" project_uuid="ABCD" file_uuid="KLMN" binary_data="[null]" line_hashes="[null]" data_hash="321654988"
- created_at="123456789" updated_at="123456789"/>
+ created_at="123456789" updated_at="123456789" data_type="SOURCE" />
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml
index d50cc3926f5..26abe5662f0 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml
@@ -104,5 +104,5 @@
build_date="1228222680000"
version="[null]" path="[null]"/>
<file_sources id="1" project_uuid="A" file_uuid="D" binary_data="[null]" line_hashes="[null]" data_hash="321654987"
- created_at="123456789" updated_at="123456789"/>
+ created_at="123456789" updated_at="123456789" data_type="SOURCE" />
</dataset>