From 58d04f69bb33f17cfe6db3d9885fe4c9adabd2d1 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 8 Oct 2019 17:51:53 +0200 Subject: SONAR-12512 Allow configuration of multiple GitHub instances --- .../org/sonar/db/alm/setting/AlmSettingMapper.xml | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 server/sonar-db-dao/src/main/resources/org/sonar/db/alm/setting/AlmSettingMapper.xml (limited to 'server/sonar-db-dao/src/main/resources') diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/alm/setting/AlmSettingMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/alm/setting/AlmSettingMapper.xml new file mode 100644 index 00000000000..bf66e2983fe --- /dev/null +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/alm/setting/AlmSettingMapper.xml @@ -0,0 +1,86 @@ + + + + + + + a.kee as key, + a.uuid as uuid, + a.alm_id as rawAlm, + a.url as url, + a.app_id as appId, + a.private_key as privateKey, + a.pat as personalAccessToken, + a.created_at as createdAt, + a.updated_at as updatedAt + + + + + + + + + + + INSERT INTO alm_settings + ( + uuid, + kee, + alm_id, + url, + app_id, + private_key, + pat, + created_at, + updated_at + ) + VALUES ( + #{uuid, jdbcType=VARCHAR}, + #{dto.key, jdbcType=VARCHAR}, + #{dto.rawAlm, jdbcType=VARCHAR}, + #{dto.url, jdbcType=VARCHAR}, + #{dto.appId, jdbcType=VARCHAR}, + #{dto.privateKey, jdbcType=VARCHAR}, + #{dto.personalAccessToken, jdbcType=VARCHAR}, + #{now, jdbcType=BIGINT}, + #{now, jdbcType=BIGINT} + ) + + + + UPDATE alm_settings + + kee = #{dto.key, jdbcType=VARCHAR}, + url = #{dto.url, jdbcType=VARCHAR}, + app_id = #{dto.appId, jdbcType=VARCHAR}, + private_key = #{dto.privateKey, jdbcType=VARCHAR}, + pat = #{dto.personalAccessToken, jdbcType=VARCHAR}, + updated_at = #{now, jdbcType=BIGINT} + + + uuid = #{dto.uuid, jdbcType=VARCHAR} + + + + + DELETE FROM alm_settings WHERE kee = #{key, jdbcType=VARCHAR} + + + + -- cgit v1.2.3