diff options
author | Dimitris Kavvathas <dimitris.kavvathas@sonarsource.com> | 2023-07-21 16:11:55 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-08-02 20:03:03 +0000 |
commit | 912879e09fecb272a2b6fc5e6e0e03ad7ac2420e (patch) | |
tree | b57cdd58e112ca37f1454e6c371fb56372480b76 /server/sonar-db-migration | |
parent | bb784c0d359bdb37286c77d25897728b8ea85563 (diff) | |
download | sonarqube-912879e09fecb272a2b6fc5e6e0e03ad7ac2420e.tar.gz sonarqube-912879e09fecb272a2b6fc5e6e0e03ad7ac2420e.zip |
SONAR-19372 Add filePath field in anticipated_transitions and the associated query logic
Diffstat (limited to 'server/sonar-db-migration')
2 files changed, 3 insertions, 2 deletions
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTable.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTable.java index 336a5221f2a..52be2d0fd48 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTable.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTable.java @@ -25,6 +25,7 @@ import org.sonar.server.platform.db.migration.sql.CreateTableBuilder; import org.sonar.server.platform.db.migration.step.CreateTableChange; import org.sonar.server.platform.db.migration.step.DdlChange; +import static org.sonar.server.platform.db.migration.def.BigIntegerColumnDef.newBigIntegerColumnDefBuilder; import static org.sonar.server.platform.db.migration.def.IntegerColumnDef.newIntegerColumnDefBuilder; import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.MAX_SIZE; import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.USER_UUID_SIZE; @@ -45,12 +46,13 @@ public class CreateAnticipatedTransitionsTable extends CreateTableChange { .addColumn(newVarcharColumnDefBuilder().setColumnName("project_uuid").setIsNullable(false).setLimit(UUID_SIZE).build()) .addColumn(newVarcharColumnDefBuilder().setColumnName("user_uuid").setIsNullable(false).setLimit(USER_UUID_SIZE).build()) .addColumn(newVarcharColumnDefBuilder().setColumnName("transition").setIsNullable(false).setLimit(20).build()) - .addColumn(newVarcharColumnDefBuilder().setColumnName("status").setIsNullable(false).setLimit(20).build()) .addColumn(newVarcharColumnDefBuilder().setColumnName("transition_comment").setLimit(MAX_SIZE).build()) .addColumn(newIntegerColumnDefBuilder().setColumnName("line").build()) .addColumn(newVarcharColumnDefBuilder().setColumnName("message").setLimit(MAX_SIZE).build()) .addColumn(newVarcharColumnDefBuilder().setColumnName("line_hash").setLimit(255).build()) .addColumn(newVarcharColumnDefBuilder().setColumnName("rule_key").setIsNullable(false).setLimit(200).build()) + .addColumn(newVarcharColumnDefBuilder().setColumnName("file_path").setIsNullable(false).setLimit(1500).build()) + .addColumn(newBigIntegerColumnDefBuilder().setColumnName("created_at").setIsNullable(false).build()) .build()); } } diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTableTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTableTest.java index ece98e04f34..b38e90b6208 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTableTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTableTest.java @@ -48,7 +48,6 @@ public class CreateAnticipatedTransitionsTableTest { db.assertColumnDefinition(ANTICIPATED_TRANSITIONS_TABLE_NAME, "project_uuid", Types.VARCHAR, UUID_SIZE, false); db.assertColumnDefinition(ANTICIPATED_TRANSITIONS_TABLE_NAME, "user_uuid", Types.VARCHAR, USER_UUID_SIZE, false); db.assertColumnDefinition(ANTICIPATED_TRANSITIONS_TABLE_NAME, "transition", Types.VARCHAR, 20, false); - db.assertColumnDefinition(ANTICIPATED_TRANSITIONS_TABLE_NAME, "status", Types.VARCHAR, 20, false); db.assertColumnDefinition(ANTICIPATED_TRANSITIONS_TABLE_NAME, "transition_comment", Types.VARCHAR, MAX_SIZE, true); db.assertColumnDefinition(ANTICIPATED_TRANSITIONS_TABLE_NAME, "line", Types.INTEGER, 11, true); db.assertColumnDefinition(ANTICIPATED_TRANSITIONS_TABLE_NAME, "message", Types.VARCHAR, MAX_SIZE, true); |