aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-db-dao/src/schema/schema-sq.ddl64
1 files changed, 32 insertions, 32 deletions
diff --git a/server/sonar-db-dao/src/schema/schema-sq.ddl b/server/sonar-db-dao/src/schema/schema-sq.ddl
index 806a0a2a69a..c7cd6763301 100644
--- a/server/sonar-db-dao/src/schema/schema-sq.ddl
+++ b/server/sonar-db-dao/src/schema/schema-sq.ddl
@@ -14,9 +14,9 @@ CREATE TABLE "SCHEMA_MIGRATIONS"(
);
CREATE TABLE "ACTIVE_RULE_PARAMETERS"(
+ "UUID" VARCHAR(40) NOT NULL,
"VALUE" VARCHAR(4000),
"RULES_PARAMETER_KEY" VARCHAR(128),
- "UUID" VARCHAR(40) NOT NULL,
"ACTIVE_RULE_UUID" VARCHAR(40) NOT NULL,
"RULES_PARAMETER_UUID" VARCHAR(40) NOT NULL
);
@@ -24,11 +24,11 @@ ALTER TABLE "ACTIVE_RULE_PARAMETERS" ADD CONSTRAINT "PK_ACTIVE_RULE_PARAMETERS"
CREATE INDEX "ARP_ACTIVE_RULE_UUID" ON "ACTIVE_RULE_PARAMETERS"("ACTIVE_RULE_UUID");
CREATE TABLE "ACTIVE_RULES"(
+ "UUID" VARCHAR(40) NOT NULL,
"FAILURE_LEVEL" INTEGER NOT NULL,
"INHERITANCE" VARCHAR(10),
"CREATED_AT" BIGINT,
"UPDATED_AT" BIGINT,
- "UUID" VARCHAR(40) NOT NULL,
"PROFILE_UUID" VARCHAR(40) NOT NULL,
"RULE_UUID" VARCHAR(40) NOT NULL
);
@@ -249,13 +249,13 @@ CREATE UNIQUE INDEX "UNIQ_DEPRECATED_RULE_KEYS" ON "DEPRECATED_RULE_KEYS"("OLD_R
CREATE INDEX "RULE_UUID_DEPRECATED_RULE_KEYS" ON "DEPRECATED_RULE_KEYS"("RULE_UUID");
CREATE TABLE "DUPLICATIONS_INDEX"(
+ "UUID" VARCHAR(40) NOT NULL,
"ANALYSIS_UUID" VARCHAR(50) NOT NULL,
"COMPONENT_UUID" VARCHAR(50) NOT NULL,
"HASH" VARCHAR(50) NOT NULL,
"INDEX_IN_FILE" INTEGER NOT NULL,
"START_LINE" INTEGER NOT NULL,
- "END_LINE" INTEGER NOT NULL,
- "UUID" VARCHAR(40) NOT NULL
+ "END_LINE" INTEGER NOT NULL
);
ALTER TABLE "DUPLICATIONS_INDEX" ADD CONSTRAINT "PK_DUPLICATIONS_INDEX" PRIMARY KEY("UUID");
CREATE INDEX "DUPLICATIONS_INDEX_HASH" ON "DUPLICATIONS_INDEX"("HASH");
@@ -306,6 +306,7 @@ CREATE INDEX "EVENTS_ANALYSIS" ON "EVENTS"("ANALYSIS_UUID");
CREATE INDEX "EVENTS_COMPONENT_UUID" ON "EVENTS"("COMPONENT_UUID");
CREATE TABLE "FILE_SOURCES"(
+ "UUID" VARCHAR(40) NOT NULL,
"PROJECT_UUID" VARCHAR(50) NOT NULL,
"FILE_UUID" VARCHAR(50) NOT NULL,
"LINE_HASHES" CLOB,
@@ -316,8 +317,7 @@ CREATE TABLE "FILE_SOURCES"(
"LINE_COUNT" INTEGER NOT NULL,
"BINARY_DATA" BLOB,
"CREATED_AT" BIGINT NOT NULL,
- "UPDATED_AT" BIGINT NOT NULL,
- "UUID" VARCHAR(40) NOT NULL
+ "UPDATED_AT" BIGINT NOT NULL
);
ALTER TABLE "FILE_SOURCES" ADD CONSTRAINT "PK_FILE_SOURCES" PRIMARY KEY("UUID");
CREATE UNIQUE INDEX "FILE_SOURCES_FILE_UUID" ON "FILE_SOURCES"("FILE_UUID");
@@ -325,9 +325,9 @@ CREATE INDEX "FILE_SOURCES_PROJECT_UUID" ON "FILE_SOURCES"("PROJECT_UUID");
CREATE INDEX "FILE_SOURCES_UPDATED_AT" ON "FILE_SOURCES"("UPDATED_AT");
CREATE TABLE "GROUP_ROLES"(
+ "UUID" VARCHAR(40) NOT NULL,
"ROLE" VARCHAR(64) NOT NULL,
"COMPONENT_UUID" VARCHAR(40),
- "UUID" VARCHAR(40) NOT NULL,
"GROUP_UUID" VARCHAR(40)
);
ALTER TABLE "GROUP_ROLES" ADD CONSTRAINT "PK_GROUP_ROLES" PRIMARY KEY("UUID");
@@ -335,11 +335,11 @@ CREATE INDEX "GROUP_ROLES_COMPONENT_UUID" ON "GROUP_ROLES"("COMPONENT_UUID");
CREATE UNIQUE INDEX "UNIQ_GROUP_ROLES" ON "GROUP_ROLES"("GROUP_UUID", "COMPONENT_UUID", "ROLE");
CREATE TABLE "GROUPS"(
+ "UUID" VARCHAR(40) NOT NULL,
"NAME" VARCHAR(500) NOT NULL,
"DESCRIPTION" VARCHAR(200),
"CREATED_AT" TIMESTAMP,
- "UPDATED_AT" TIMESTAMP,
- "UUID" VARCHAR(40) NOT NULL
+ "UPDATED_AT" TIMESTAMP
);
ALTER TABLE "GROUPS" ADD CONSTRAINT "PK_GROUPS" PRIMARY KEY("UUID");
CREATE UNIQUE INDEX "UNIQ_GROUPS_NAME" ON "GROUPS"("NAME");
@@ -446,6 +446,7 @@ CREATE INDEX "LIVE_MEASURES_PROJECT" ON "LIVE_MEASURES"("PROJECT_UUID");
CREATE UNIQUE INDEX "LIVE_MEASURES_COMPONENT" ON "LIVE_MEASURES"("COMPONENT_UUID", "METRIC_UUID");
CREATE TABLE "MANUAL_MEASURES"(
+ "UUID" VARCHAR(40) NOT NULL,
"VALUE" DOUBLE,
"TEXT_VALUE" VARCHAR(4000),
"USER_UUID" VARCHAR(255),
@@ -453,13 +454,13 @@ CREATE TABLE "MANUAL_MEASURES"(
"CREATED_AT" BIGINT,
"UPDATED_AT" BIGINT,
"COMPONENT_UUID" VARCHAR(50) NOT NULL,
- "UUID" VARCHAR(40) NOT NULL,
"METRIC_UUID" VARCHAR(40) NOT NULL
);
ALTER TABLE "MANUAL_MEASURES" ADD CONSTRAINT "PK_MANUAL_MEASURES" PRIMARY KEY("UUID");
CREATE INDEX "MANUAL_MEASURES_COMPONENT_UUID" ON "MANUAL_MEASURES"("COMPONENT_UUID");
CREATE TABLE "METRICS"(
+ "UUID" VARCHAR(40) NOT NULL,
"NAME" VARCHAR(64) NOT NULL,
"DESCRIPTION" VARCHAR(255),
"DIRECTION" INTEGER DEFAULT 0 NOT NULL,
@@ -474,8 +475,7 @@ CREATE TABLE "METRICS"(
"OPTIMIZED_BEST_VALUE" BOOLEAN,
"HIDDEN" BOOLEAN,
"DELETE_HISTORICAL_DATA" BOOLEAN,
- "DECIMAL_SCALE" INTEGER,
- "UUID" VARCHAR(40) NOT NULL
+ "DECIMAL_SCALE" INTEGER
);
ALTER TABLE "METRICS" ADD CONSTRAINT "PK_METRICS" PRIMARY KEY("UUID");
CREATE UNIQUE INDEX "METRICS_UNIQUE_NAME" ON "METRICS"("NAME");
@@ -495,8 +495,8 @@ CREATE INDEX "IDX_NCP_TYPE" ON "NEW_CODE_PERIODS"("TYPE");
CREATE INDEX "IDX_NCP_VALUE" ON "NEW_CODE_PERIODS"("VALUE");
CREATE TABLE "NOTIFICATIONS"(
- "DATA" BLOB,
"UUID" VARCHAR(40) NOT NULL,
+ "DATA" BLOB,
"CREATED_AT" BIGINT NOT NULL
);
ALTER TABLE "NOTIFICATIONS" ADD CONSTRAINT "PK_NOTIFICATIONS" PRIMARY KEY("UUID");
@@ -515,43 +515,43 @@ CREATE INDEX "QPROFILES_RP_UUID" ON "ORG_QPROFILES"("RULES_PROFILE_UUID");
CREATE INDEX "ORG_QPROFILES_PARENT_UUID" ON "ORG_QPROFILES"("PARENT_UUID");
CREATE TABLE "PERM_TEMPLATES_GROUPS"(
+ "UUID" VARCHAR(40) NOT NULL,
"PERMISSION_REFERENCE" VARCHAR(64) NOT NULL,
"CREATED_AT" TIMESTAMP,
"UPDATED_AT" TIMESTAMP,
- "UUID" VARCHAR(40) NOT NULL,
"TEMPLATE_UUID" VARCHAR(40) NOT NULL,
"GROUP_UUID" VARCHAR(40)
);
ALTER TABLE "PERM_TEMPLATES_GROUPS" ADD CONSTRAINT "PK_PERM_TEMPLATES_GROUPS" PRIMARY KEY("UUID");
CREATE TABLE "PERM_TEMPLATES_USERS"(
+ "UUID" VARCHAR(40) NOT NULL,
"PERMISSION_REFERENCE" VARCHAR(64) NOT NULL,
"CREATED_AT" TIMESTAMP,
"UPDATED_AT" TIMESTAMP,
- "UUID" VARCHAR(40) NOT NULL,
"TEMPLATE_UUID" VARCHAR(40) NOT NULL,
"USER_UUID" VARCHAR(255) NOT NULL
);
ALTER TABLE "PERM_TEMPLATES_USERS" ADD CONSTRAINT "PK_PERM_TEMPLATES_USERS" PRIMARY KEY("UUID");
CREATE TABLE "PERM_TPL_CHARACTERISTICS"(
+ "UUID" VARCHAR(40) NOT NULL,
"PERMISSION_KEY" VARCHAR(64) NOT NULL,
"WITH_PROJECT_CREATOR" BOOLEAN DEFAULT FALSE NOT NULL,
"CREATED_AT" BIGINT NOT NULL,
"UPDATED_AT" BIGINT NOT NULL,
- "UUID" VARCHAR(40) NOT NULL,
"TEMPLATE_UUID" VARCHAR(40) NOT NULL
);
ALTER TABLE "PERM_TPL_CHARACTERISTICS" ADD CONSTRAINT "PK_PERM_TPL_CHARACTERISTICS" PRIMARY KEY("UUID");
CREATE UNIQUE INDEX "UNIQ_PERM_TPL_CHARAC" ON "PERM_TPL_CHARACTERISTICS"("TEMPLATE_UUID", "PERMISSION_KEY");
CREATE TABLE "PERMISSION_TEMPLATES"(
+ "UUID" VARCHAR(40) NOT NULL,
"NAME" VARCHAR(100) NOT NULL,
"DESCRIPTION" VARCHAR(4000),
"CREATED_AT" TIMESTAMP,
"UPDATED_AT" TIMESTAMP,
- "KEY_PATTERN" VARCHAR(500),
- "UUID" VARCHAR(40) NOT NULL
+ "KEY_PATTERN" VARCHAR(500)
);
ALTER TABLE "PERMISSION_TEMPLATES" ADD CONSTRAINT "PK_PERMISSION_TEMPLATES" PRIMARY KEY("UUID");
@@ -623,6 +623,7 @@ CREATE UNIQUE INDEX "KEY_TYPE_KEE" ON "PROJECT_MAPPINGS"("KEY_TYPE", "KEE");
CREATE INDEX "PROJECT_UUID" ON "PROJECT_MAPPINGS"("PROJECT_UUID");
CREATE TABLE "PROJECT_MEASURES"(
+ "UUID" VARCHAR(40) NOT NULL,
"VALUE" DOUBLE,
"ANALYSIS_UUID" VARCHAR(50) NOT NULL,
"COMPONENT_UUID" VARCHAR(50) NOT NULL,
@@ -632,7 +633,6 @@ CREATE TABLE "PROJECT_MEASURES"(
"PERSON_ID" INTEGER,
"VARIATION_VALUE_1" DOUBLE,
"MEASURE_DATA" BLOB,
- "UUID" VARCHAR(40) NOT NULL,
"METRIC_UUID" VARCHAR(40) NOT NULL
);
ALTER TABLE "PROJECT_MEASURES" ADD CONSTRAINT "PK_PROJECT_MEASURES" PRIMARY KEY("UUID");
@@ -648,9 +648,9 @@ ALTER TABLE "PROJECT_QGATES" ADD CONSTRAINT "PK_PROJECT_QGATES" PRIMARY KEY("PRO
CREATE UNIQUE INDEX "UNIQ_PROJECT_QGATES" ON "PROJECT_QGATES"("PROJECT_UUID", "QUALITY_GATE_UUID");
CREATE TABLE "PROJECT_QPROFILES"(
+ "UUID" VARCHAR(40) NOT NULL,
"PROJECT_UUID" VARCHAR(50) NOT NULL,
- "PROFILE_KEY" VARCHAR(50) NOT NULL,
- "UUID" VARCHAR(40) NOT NULL
+ "PROFILE_KEY" VARCHAR(50) NOT NULL
);
ALTER TABLE "PROJECT_QPROFILES" ADD CONSTRAINT "PK_PROJECT_QPROFILES" PRIMARY KEY("UUID");
CREATE UNIQUE INDEX "UNIQ_PROJECT_QPROFILES" ON "PROJECT_QPROFILES"("PROJECT_UUID", "PROFILE_KEY");
@@ -671,13 +671,13 @@ CREATE UNIQUE INDEX "UNIQ_PROJECTS_KEE" ON "PROJECTS"("KEE");
CREATE INDEX "IDX_QUALIFIER" ON "PROJECTS"("QUALIFIER");
CREATE TABLE "PROPERTIES"(
+ "UUID" VARCHAR(40) NOT NULL,
"PROP_KEY" VARCHAR(512) NOT NULL,
"IS_EMPTY" BOOLEAN NOT NULL,
"TEXT_VALUE" VARCHAR(4000),
"CLOB_VALUE" CLOB,
"CREATED_AT" BIGINT NOT NULL,
"COMPONENT_UUID" VARCHAR(40),
- "UUID" VARCHAR(40) NOT NULL,
"USER_UUID" VARCHAR(255)
);
ALTER TABLE "PROPERTIES" ADD CONSTRAINT "PK_PROPERTIES" PRIMARY KEY("UUID");
@@ -715,11 +715,11 @@ CREATE INDEX "QPROFILE_EDIT_USERS_QPROFILE" ON "QPROFILE_EDIT_USERS"("QPROFILE_U
CREATE UNIQUE INDEX "QPROFILE_EDIT_USERS_UNIQUE" ON "QPROFILE_EDIT_USERS"("USER_UUID", "QPROFILE_UUID");
CREATE TABLE "QUALITY_GATE_CONDITIONS"(
+ "UUID" VARCHAR(40) NOT NULL,
"OPERATOR" VARCHAR(3),
"VALUE_ERROR" VARCHAR(64),
"CREATED_AT" TIMESTAMP,
"UPDATED_AT" TIMESTAMP,
- "UUID" VARCHAR(40) NOT NULL,
"METRIC_UUID" VARCHAR(40) NOT NULL,
"QGATE_UUID" VARCHAR(40) NOT NULL
);
@@ -743,6 +743,7 @@ CREATE TABLE "RULE_REPOSITORIES"(
ALTER TABLE "RULE_REPOSITORIES" ADD CONSTRAINT "PK_RULE_REPOSITORIES" PRIMARY KEY("KEE");
CREATE TABLE "RULES"(
+ "UUID" VARCHAR(40) NOT NULL,
"NAME" VARCHAR(200),
"PLUGIN_RULE_KEY" VARCHAR(200) NOT NULL,
"PLUGIN_KEY" VARCHAR(200),
@@ -766,13 +767,13 @@ CREATE TABLE "RULES"(
"IS_EXTERNAL" BOOLEAN NOT NULL,
"CREATED_AT" BIGINT,
"UPDATED_AT" BIGINT,
- "UUID" VARCHAR(40) NOT NULL,
"TEMPLATE_UUID" VARCHAR(40)
);
ALTER TABLE "RULES" ADD CONSTRAINT "PK_RULES" PRIMARY KEY("UUID");
CREATE UNIQUE INDEX "RULES_REPO_KEY" ON "RULES"("PLUGIN_RULE_KEY", "PLUGIN_NAME");
CREATE TABLE "RULES_METADATA"(
+ "RULE_UUID" VARCHAR(40) NOT NULL,
"NOTE_DATA" CLOB,
"NOTE_USER_UUID" VARCHAR(255),
"NOTE_CREATED_AT" BIGINT,
@@ -786,17 +787,16 @@ CREATE TABLE "RULES_METADATA"(
"AD_HOC_SEVERITY" VARCHAR(10),
"AD_HOC_TYPE" TINYINT,
"CREATED_AT" BIGINT NOT NULL,
- "UPDATED_AT" BIGINT NOT NULL,
- "RULE_UUID" VARCHAR(40) NOT NULL
+ "UPDATED_AT" BIGINT NOT NULL
);
ALTER TABLE "RULES_METADATA" ADD CONSTRAINT "PK_RULES_METADATA" PRIMARY KEY("RULE_UUID");
CREATE TABLE "RULES_PARAMETERS"(
+ "UUID" VARCHAR(40) NOT NULL,
"NAME" VARCHAR(128) NOT NULL,
"DESCRIPTION" VARCHAR(4000),
"PARAM_TYPE" VARCHAR(512) NOT NULL,
"DEFAULT_VALUE" VARCHAR(4000),
- "UUID" VARCHAR(40) NOT NULL,
"RULE_UUID" VARCHAR(40) NOT NULL
);
ALTER TABLE "RULES_PARAMETERS" ADD CONSTRAINT "PK_RULES_PARAMETERS" PRIMARY KEY("UUID");
@@ -804,13 +804,13 @@ CREATE INDEX "RULES_PARAMETERS_RULE_UUID" ON "RULES_PARAMETERS"("RULE_UUID");
CREATE UNIQUE INDEX "RULES_PARAMETERS_UNIQUE" ON "RULES_PARAMETERS"("RULE_UUID", "NAME");
CREATE TABLE "RULES_PROFILES"(
+ "UUID" VARCHAR(40) NOT NULL,
"NAME" VARCHAR(100) NOT NULL,
"LANGUAGE" VARCHAR(20),
"IS_BUILT_IN" BOOLEAN NOT NULL,
"RULES_UPDATED_AT" VARCHAR(100),
"CREATED_AT" TIMESTAMP,
- "UPDATED_AT" TIMESTAMP,
- "UUID" VARCHAR(40) NOT NULL
+ "UPDATED_AT" TIMESTAMP
);
ALTER TABLE "RULES_PROFILES" ADD CONSTRAINT "PK_RULES_PROFILES" PRIMARY KEY("UUID");
@@ -876,9 +876,9 @@ ALTER TABLE "USER_PROPERTIES" ADD CONSTRAINT "PK_USER_PROPERTIES" PRIMARY KEY("U
CREATE UNIQUE INDEX "USER_PROPERTIES_USER_UUID_KEE" ON "USER_PROPERTIES"("USER_UUID", "KEE");
CREATE TABLE "USER_ROLES"(
+ "UUID" VARCHAR(40) NOT NULL,
"ROLE" VARCHAR(64) NOT NULL,
"COMPONENT_UUID" VARCHAR(40),
- "UUID" VARCHAR(40) NOT NULL,
"USER_UUID" VARCHAR(255)
);
ALTER TABLE "USER_ROLES" ADD CONSTRAINT "PK_USER_ROLES" PRIMARY KEY("UUID");
@@ -886,12 +886,12 @@ CREATE INDEX "USER_ROLES_COMPONENT_UUID" ON "USER_ROLES"("COMPONENT_UUID");
CREATE INDEX "USER_ROLES_USER" ON "USER_ROLES"("USER_UUID");
CREATE TABLE "USER_TOKENS"(
+ "UUID" VARCHAR(40) NOT NULL,
"USER_UUID" VARCHAR(255) NOT NULL,
"NAME" VARCHAR(100) NOT NULL,
"TOKEN_HASH" VARCHAR(255) NOT NULL,
"LAST_CONNECTION_DATE" BIGINT,
- "CREATED_AT" BIGINT NOT NULL,
- "UUID" VARCHAR(40) NOT NULL
+ "CREATED_AT" BIGINT NOT NULL
);
ALTER TABLE "USER_TOKENS" ADD CONSTRAINT "PK_USER_TOKENS" PRIMARY KEY("UUID");
CREATE UNIQUE INDEX "USER_TOKENS_USER_UUID_NAME" ON "USER_TOKENS"("USER_UUID", "NAME");