]> source.dussan.org Git - sonarqube.git/blob
85b848f46140efea6ca8b38aba9f77537d0f46f8
[sonarqube.git] /
1 CREATE TABLE "LIVE_MEASURES"(
2     "UUID" VARCHAR(40) NOT NULL,
3     "PROJECT_UUID" VARCHAR(50) NOT NULL,
4     "COMPONENT_UUID" VARCHAR(50) NOT NULL,
5     "METRIC_ID" INTEGER NOT NULL,
6     "METRIC_UUID" VARCHAR(40),
7     "VALUE" DOUBLE,
8     "TEXT_VALUE" VARCHAR(4000),
9     "VARIATION" DOUBLE,
10     "MEASURE_DATA" BLOB,
11     "UPDATE_MARKER" VARCHAR(40),
12     "CREATED_AT" BIGINT NOT NULL,
13     "UPDATED_AT" BIGINT NOT NULL
14 );
15 ALTER TABLE "LIVE_MEASURES" ADD CONSTRAINT "PK_LIVE_MEASURES" PRIMARY KEY("UUID");
16 CREATE INDEX "LIVE_MEASURES_PROJECT" ON "LIVE_MEASURES"("PROJECT_UUID");
17 CREATE UNIQUE INDEX "LIVE_MEASURES_COMPONENT" ON "LIVE_MEASURES"("COMPONENT_UUID", "METRIC_ID");
18
19 CREATE TABLE "METRICS"(
20     "ID" INTEGER NOT NULL,
21     "UUID" VARCHAR(40) NOT NULL,
22     "NAME" VARCHAR(64) NOT NULL,
23     "DESCRIPTION" VARCHAR(255),
24     "DIRECTION" INTEGER DEFAULT 0 NOT NULL,
25     "DOMAIN" VARCHAR(64),
26     "SHORT_NAME" VARCHAR(64),
27     "QUALITATIVE" BOOLEAN DEFAULT FALSE NOT NULL,
28     "VAL_TYPE" VARCHAR(8),
29     "USER_MANAGED" BOOLEAN DEFAULT FALSE,
30     "ENABLED" BOOLEAN DEFAULT TRUE,
31     "WORST_VALUE" DOUBLE,
32     "BEST_VALUE" DOUBLE,
33     "OPTIMIZED_BEST_VALUE" BOOLEAN,
34     "HIDDEN" BOOLEAN,
35     "DELETE_HISTORICAL_DATA" BOOLEAN,
36     "DECIMAL_SCALE" INTEGER
37 );
38 ALTER TABLE "METRICS" ADD CONSTRAINT "PK_METRICS" PRIMARY KEY("ID");
39 CREATE UNIQUE INDEX "METRICS_UNIQUE_NAME" ON "METRICS"("NAME");