aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-03-26 14:24:02 +0100
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-03-26 14:51:08 +0100
commit6eb670a7d276a1a0f046a5f1925f29e1727eec23 (patch)
treece4d43c6a71963eafdb8f68bf4d057be6f36d0dc /sonar-core
parentc361f824ba490fe69138205c56e2679800497405 (diff)
downloadsonarqube-6eb670a7d276a1a0f046a5f1925f29e1727eec23.tar.gz
sonarqube-6eb670a7d276a1a0f046a5f1925f29e1727eec23.zip
SONAR-6325 Apply feedback from PR
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl4
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml14
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/projects.xml8
4 files changed, 14 insertions, 14 deletions
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 2e2c8fb1f4c..78d238fd14a 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
@@ -76,7 +76,7 @@ public class DatabaseVersion implements BatchComponent, ServerComponent {
"projects",
"project_links",
"project_measures",
- "project_profiles",
+ "project_qprofiles",
"properties",
"resource_index",
"rules",
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 12207946a88..5ebe86e0e1b 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
@@ -56,7 +56,7 @@ CREATE TABLE "RULES_PROFILES" (
"UPDATED_AT" TIMESTAMP
);
-CREATE TABLE "PROJECT_PROFILES" (
+CREATE TABLE "PROJECT_QPROFILES" (
"ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
"PROJECT_UUID" VARCHAR(50) NOT NULL,
"PROFILE_KEY" VARCHAR(255) NOT NULL
@@ -718,4 +718,4 @@ CREATE UNIQUE INDEX "FILE_SOURCES_FILE_UUID_UNIQ" ON "FILE_SOURCES" ("FILE_UUID"
CREATE INDEX "FILE_SOURCES_UPDATED_AT" ON "FILE_SOURCES" ("UPDATED_AT");
-CREATE UNIQUE INDEX "PROJECT_PROFILES_UNIQUE" ON "PROJECT_PROFILES" ("PROJECT_UUID", "PROFILE_KEY");
+CREATE UNIQUE INDEX "PROJECT_QPROFILES_UNIQUE" ON "PROJECT_QPROFILES" ("PROJECT_UUID", "PROFILE_KEY");
diff --git a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml
index 8d76a86144f..8f069d0b366 100644
--- a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml
@@ -95,7 +95,7 @@
<select id="selectProjects" parameterType="Integer" resultType="Component">
SELECT projects.id as id, projects.name as name, projects.kee as kee, projects.uuid as uuid
FROM projects projects
- JOIN project_profiles pp ON pp.project_uuid = projects.uuid
+ JOIN project_qprofiles pp ON pp.project_uuid = projects.uuid
JOIN rules_profiles prof ON pp.profile_key = prof.kee
<where>
AND prof.name = #{profileName}
@@ -106,7 +106,7 @@
<select id="countProjects" parameterType="Integer" resultType="Integer">
SELECT count(projects.id)
FROM projects projects
- JOIN project_profiles pp ON pp.project_uuid=projects.uuid
+ JOIN project_qprofiles pp ON pp.project_uuid=projects.uuid
JOIN rules_profiles prof ON pp.profile_key=prof.kee
<where>
AND prof.language=#{language}
@@ -117,7 +117,7 @@
<select id="selectByProjectIdAndLanguage" parameterType="map" resultType="QualityProfile">
SELECT <include refid="profilesColumns"/>
FROM rules_profiles p
- JOIN project_profiles pp ON pp.profile_key=p.kee
+ JOIN project_qprofiles pp ON pp.profile_key=p.kee
JOIN projects project ON pp.project_uuid=project.uuid
AND project.id=#{projectId}
WHERE p.language=#{language}
@@ -126,22 +126,22 @@
<select id="selectByProjectAndLanguage" parameterType="map" resultType="QualityProfile">
SELECT <include refid="profilesColumns"/>
FROM rules_profiles p
- JOIN project_profiles pp ON pp.profile_key=p.kee
+ JOIN project_qprofiles pp ON pp.profile_key=p.kee
JOIN projects project ON pp.project_uuid=project.uuid
AND project.kee=#{projectKey}
WHERE p.language=#{language}
</select>
<insert id="insertProjectProfileAssociation" keyColumn="id" useGeneratedKeys="true">
- INSERT INTO project_profiles (project_uuid, profile_key) VALUES (#{projectUuid}, #{profileKey})
+ INSERT INTO project_qprofiles (project_uuid, profile_key) VALUES (#{projectUuid}, #{profileKey})
</insert>
<update id="deleteProjectProfileAssociation">
- DELETE FROM project_profiles WHERE project_uuid=#{projectUuid} AND profile_key=#{profileKey}
+ DELETE FROM project_qprofiles WHERE project_uuid=#{projectUuid} AND profile_key=#{profileKey}
</update>
<update id="deleteAllProjectProfileAssociation">
- DELETE FROM project_profiles WHERE profile_key=#{profileKey}
+ DELETE FROM project_qprofiles WHERE profile_key=#{profileKey}
</update>
</mapper>
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/projects.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/projects.xml
index 5cc32bfefad..8e6fb4c83af 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/projects.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/projects.xml
@@ -8,9 +8,9 @@
<projects id="1" uuid="A" kee="org.codehaus.sonar:sonar" name="SonarQube"/>
<projects id="2" uuid="B" kee="org.codehaus.sonar-plugins.java:java" name="SonarQube Java"/>
- <project_profiles id="1" project_uuid="A" profile_key="java_sonar_way"/>
- <project_profiles id="2" project_uuid="B" profile_key="java_sonar_way"/>
- <project_profiles id="3" project_uuid="A" profile_key="js_sonar_way"/>
- <project_profiles id="4" project_uuid="B" profile_key="js_sonar_way"/>
+ <project_qprofiles id="1" project_uuid="A" profile_key="java_sonar_way"/>
+ <project_qprofiles id="2" project_uuid="B" profile_key="java_sonar_way"/>
+ <project_qprofiles id="3" project_uuid="A" profile_key="js_sonar_way"/>
+ <project_qprofiles id="4" project_uuid="B" profile_key="js_sonar_way"/>
</dataset>