aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-03-23 11:10:38 +0100
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-03-26 14:51:07 +0100
commitdd25739100ba7e9b2ad426e8b635692241387465 (patch)
tree2b28fe9e7effc1410a63c3b37a912e7689fbc28f /sonar-core
parent9fa69bb5e8c43629d9903749d52fcbb6b0c0be74 (diff)
downloadsonarqube-dd25739100ba7e9b2ad426e8b635692241387465.tar.gz
sonarqube-dd25739100ba7e9b2ad426e8b635692241387465.zip
SONAR-6326 Add project_profiles association table
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java3
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql1
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl8
3 files changed, 11 insertions, 1 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 72d79512ceb..1b49d131f0e 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 = 905;
+ public static final int LAST_VERSION = 906;
/**
* List of all the tables.n
@@ -76,6 +76,7 @@ public class DatabaseVersion implements BatchComponent, ServerComponent {
"projects",
"project_links",
"project_measures",
+ "project_profiles",
"properties",
"resource_index",
"rules",
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 33e1daf7412..d4ba09adb1d 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
@@ -329,6 +329,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('902');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('903');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('904');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('905');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('906');
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 95fa86aa4e7..09a226168ae 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
@@ -55,6 +55,12 @@ CREATE TABLE "RULES_PROFILES" (
"UPDATED_AT" TIMESTAMP
);
+CREATE TABLE "PROJECT_PROFILES" (
+ "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
+);
+
CREATE TABLE "WIDGETS" (
"ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
"DASHBOARD_ID" INTEGER NOT NULL,
@@ -710,3 +716,5 @@ 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 INDEX "FILE_SOURCES_UPDATED_AT" ON "FILE_SOURCES" ("UPDATED_AT");
+
+CREATE UNIQUE INDEX "PROJECT_PROFILES_UNIQUE" ON "PROJECT_PROFILES" ("PROJECT_UUID", "PROFILE_KEY");