diff options
author | Jacek Poreda <jacek.poreda@sonarsource.com> | 2024-11-21 10:59:38 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-11-29 20:03:06 +0000 |
commit | 7aeeaa3fe7b3a491385d467f523a6273a06053fd (patch) | |
tree | 124b362a30a7af89d1cc622ca73f8bc1cc06756c /server/sonar-db-dao | |
parent | 2e581ba13369a28401e3ea359579f977b2c8a3c0 (diff) | |
download | sonarqube-7aeeaa3fe7b3a491385d467f523a6273a06053fd.tar.gz sonarqube-7aeeaa3fe7b3a491385d467f523a6273a06053fd.zip |
SONAR-23619 Add DB migration for 'quality_gates' table to add 'ai_code_supported' boolean flag
Diffstat (limited to 'server/sonar-db-dao')
4 files changed, 14 insertions, 2 deletions
diff --git a/server/sonar-db-dao/src/it/java/org/sonar/db/qualitygate/QualityGateDaoIT.java b/server/sonar-db-dao/src/it/java/org/sonar/db/qualitygate/QualityGateDaoIT.java index 7d588c0d1e8..a953a97d098 100644 --- a/server/sonar-db-dao/src/it/java/org/sonar/db/qualitygate/QualityGateDaoIT.java +++ b/server/sonar-db-dao/src/it/java/org/sonar/db/qualitygate/QualityGateDaoIT.java @@ -63,6 +63,7 @@ class QualityGateDaoIT { assertThat(reloaded.getName()).isEqualTo("My Quality Gate"); assertThat(reloaded.getUuid()).isEqualTo(newQgate.getUuid()); assertThat(reloaded.isBuiltIn()).isFalse(); + assertThat(reloaded.isAiCodeSupported()).isFalse(); assertThat(reloaded.getCreatedAt()).isNotNull(); assertThat(reloaded.getUpdatedAt()).isNotNull(); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/QualityGateDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/QualityGateDto.java index 4d48cfada0d..5ef681fb22e 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/QualityGateDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/QualityGateDto.java @@ -29,6 +29,7 @@ public class QualityGateDto { private String name; private String uuid; private boolean isBuiltIn; + private boolean aiCodeSupported; private Date createdAt; private Date updatedAt; @@ -59,6 +60,15 @@ public class QualityGateDto { return this; } + public boolean isAiCodeSupported() { + return aiCodeSupported; + } + + public QualityGateDto setAiCodeSupported(boolean aiCodeSupported) { + this.aiCodeSupported = aiCodeSupported; + return this; + } + public Date getCreatedAt() { return createdAt; } diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/QualityGateMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/QualityGateMapper.xml index 3465cb761f2..2036ff7ac4d 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/QualityGateMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/QualityGateMapper.xml @@ -3,7 +3,7 @@ <mapper namespace="org.sonar.db.qualitygate.QualityGateMapper"> <sql id="gateColumns"> - qg.uuid, qg.name, qg.is_built_in as isBuiltIn, qg.created_at as createdAt, qg.updated_at as updatedAt + qg.uuid, qg.name, qg.is_built_in as isBuiltIn, qg.ai_code_supported as aiCodeSupported, qg.created_at as createdAt, qg.updated_at as updatedAt </sql> <sql id="qualityGateFindingColumns"> diff --git a/server/sonar-db-dao/src/schema/schema-sq.ddl b/server/sonar-db-dao/src/schema/schema-sq.ddl index 34cfb933d22..eaa9aa9cf7f 100644 --- a/server/sonar-db-dao/src/schema/schema-sq.ddl +++ b/server/sonar-db-dao/src/schema/schema-sq.ddl @@ -898,7 +898,8 @@ CREATE TABLE "QUALITY_GATES"( "NAME" CHARACTER VARYING(100) NOT NULL, "IS_BUILT_IN" BOOLEAN NOT NULL, "CREATED_AT" TIMESTAMP, - "UPDATED_AT" TIMESTAMP + "UPDATED_AT" TIMESTAMP, + "AI_CODE_SUPPORTED" BOOLEAN DEFAULT FALSE NOT NULL ); ALTER TABLE "QUALITY_GATES" ADD CONSTRAINT "PK_QUALITY_GATES" PRIMARY KEY("UUID"); |